When I click the div
, the color
of the span
changes to red
, as i expected, but when I refresh my page the color
isn't red
, it returns back to original color, in my case green
. How can I preserve the same color (red) after refreshing the page?
I event tried with .apend()
but the situation is the same.
This is my HTML:
<span>Green</span>
<div id="changeColor"> </div>
jQuery:
$('#changeColor').click(function(){
$('span').css({"background-color":"red"});
});
Thank you all :D