I have 2 button and i want to change background image of that button which is clicked.
<input style="float:right; padding-right:10px;" name="comp_sephora" id="comp_sephora" type="submit" value="Sephora" onClick="change(this.style);">
<input style="float:right;" type="submit" name="comp_bloom" id="comp_bloom" value="Bloom" onClick="change(this.style);">
i have used javascript function for that:
function change(style)
{
//alert(val);
style.backgroundImage = "url(<?php echo IMAGES."btn1.bmp"; ?>)";
//style.color = "#000000";
}
but when i was clicked then image changed for only few seconds. i want to maintain that image after page reload.