Reputation: 59491
How to disable all the controls(buttons, anchor, textbox,...) in the page using jquery. I need this to show a preview of a page, in which i don't want to the user to click anything.
Upvotes: 4
Views: 13838
Reputation: 9252
$("#id_button").attr("disabled","disabled");
or
$(".class_buttons").attr("disabled","disabled");
or
$(":input").attr("disabled","disabled");
Upvotes: 14
Reputation: 187030
The best way will be to show a div on top of all other elements. Make the stacking order of this div to be the highest in the document so that click won't be made on any other elements.
Specifying the stack level: the 'z-index' property
Upvotes: -1
Reputation: 6973
This may work:
$(document).click(function(evt){ evt.preventDefault; });
Upvotes: 0