jquery - How to keep a value unchanged? -



jquery - How to keep a value unchanged? -

this basic question, but...

<div id="caption">323</div> var = $("#caption").html();

now, content of #caption changed...

and need starting value (323)

alert (a);

but result new value.

how can maintain starting value unchanged ?

var old=$('#caption').html(); $('#sub').on('click',function(){ $('#caption').html('525'); alert(old); });

demo

jquery

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -