'Can i use ejs for render values from server and use it as an attribute value inside html TAG?

Anyone help me with this? How to do this ?this is my app.js fileThis is my index.ejs file

<h1 style="color:'<%= color %>'">

I also tried like this,but did not get result as expected.



Solution 1:[1]

i changed color value to "color:red" and used inside H1 Like this

Now its working.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AML