Passing sightly property or variable inside js function

Avatar

Avatar

LaMind3

Avatar

LaMind3

LaMind3

04-10-2020

I am trying to pass slightly property - ${tabs.id} to openSection() as shown below.

<button class="tablinks" onclick="openSection(event, ${tabs.id}-section)">${tabs.tabname}</button>

But I see - onclick="openSection(event, -section)" in html when component is rendered.

 

whereas below expression works.

<div id="${tabs.id}-section" class="section">

html output:  

<div id="first-section" class="section">

 

How can pass this property to openSection() to make this work?

View Entire Topic

Avatar

Avatar

Nikhil-Kumar

MVP

Avatar

Nikhil-Kumar

MVP

Nikhil-Kumar
MVP

05-10-2020

@LaMind3 

Try using @content along with the sightly prop that you are fetching and displaying.