Javascript inside HTML tags -


i want reference javascript variable inside html tag this:

<ul data-target="#{this.state.name}"></ul> 

but doesn't seem valid syntax. know possible in coffeescript, there similar syntax in javascript? i'm using es6.

you seem looking template literals allow string interpolation in es6. equivalent coffeescript's

"<ul data-target=\"#{this.state.name}\"></ul>" 

would be

`<ul data-target="${this.state.name}"></ul>` 

Comments

Popular posts from this blog

Multilayer CSV to filtered excel -

Listboxes in c# -

ios - Why must I define variables twice in the Header file? -