I have a html field called styles, which gets its value from a php value:
<input name="styles" value="'.$colorstyle.'" id="styles" >
Now I have a javascript code, in which I need the value of the field to place in:
this.colours = {
'normal' : {
'txt' : "rgb(255,255,255)",
'arrow':"rgb(0,0,0)",
}
};
I have tried below code in the javascript file, but I'm not getting the right output. Also, I don't know how to debug this.
var arrowcolor = document.getElementById('styles').innerHTML
this.colours = {
'normal' : {
'txt' : "rgb(255,255,255)",
'arrow':"'+arrowcolor+'",
}
};