I meet the requirement where i get the js statements from the user and apply to the page
for some reason i have to keep track state of the element
i am facing problem when user gives the statments like
$("someselector").css("color":"red");
or
$("someselector").html("new text");
i will get the statements and apply in page, here i am not able to take the backup of original element
is there any way in jquery where i can call a hook function before calling css , html function and take the element backup
.clone()?var clonedObj = $('some_selector').clone()you cloned the object to clonedObj. This can be your backup element. After you do the$("someselector").html("new text");you still have the clonedObj element with unchanged text.