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

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -