I am doing a jQuery for hotel project. visibility hidden is not working when i come back from next page to previous page.
This is my code:
$("select#rooms").live("change",function() {
if ($('select#rooms option:selected').val()==2) {
$("#see1").css("visibility","visible");
} else {
$("#see1").css("visibility","hidden");
}
});
I believe on() is the new standard to use instead of live(). With regards to your issue, I believe most browsers do not preserve state when navigating back to a page. The only exception to this rule is Firefox. You could try adding an onready() handler to re-evaluate DOM objects on the page.