Skip to content Skip to sidebar Skip to footer

Html - Changing Color In Text Area From An Option Inside Of A Select Box Generated From Mysql

I have been trying to search for things similar to what I want but can't seem to get the exact solution. I am in no way a HTML coder, but I have to do some work in HTML, so I am le

Solution 1:

You have not given the elements an ID you have given them a CLASS. so getElementById() will not work. Change the html to add the ID not the CLASS.

Solution 2:

functionupdateColor(color){
 myCell = document.getElementById('2ndInputSun');     
        myCell.firstChild.style.backgroundColor = "#"+color;

}

This will change color of textarea (firstChild of td).

Also, you can simplify this: onchange="updateColor(this.value);

Demo: http://jsfiddle.net/hrybcahk/

Post a Comment for "Html - Changing Color In Text Area From An Option Inside Of A Select Box Generated From Mysql"