SO - 22190953
by Arun P Johny
HTML
<input type="button" name="Ignore Select" value="Ignore Select" id="select" onclick="colorchange('select')" style="background:rgb(255,145,0);" />
<input type="button" name="Ignore Delete" value="Ignore Delete" id="select1" onclick="colorchange('select1');" style="background:rgb(255,145,0);" />
<input type="button" name="Ignore Insert" value="Ignore Insert" id="select2" onclick="colorchange('select2');" style="background:rgb(255,145,0);" />
<input type="button" name="Ignore Update" value="Ignore Update" id="select3" onclick="colorchange('select3');" style="background:rgb(255,145,0);" />
<input type="button" name="Ignore Sleep" value="Ignore Sleep" id="select4" onclick="colorchange('select4');" style="background:rgb(255,145,0);" />
JavaScript
function colorchange(id) {
var background = document.getElementById(id).style.backgroundColor;
if (background == "rgb(255, 145, 0)") {
document.getElementById(id).style.background = "rgb(26,255,0)";
} else {
document.getElementById(id).style.background = "rgb(255,145,0)";
}
}