How can we disable all the elements in html through javascript.The easiest way...
The disabled attribute is a boolean attribute. When present, it specifies that the element should be disabled. A disabled element is unusable. The disabled attribute can be set to keep a user from using the element until some other condition has been met (like selecting a checkbox, etc.).
You can't disable it completely. Web Console Inspectors are designed for HTML and JavaScript debugging. They do this by displaying the live DOM object on the web page. This means that it exposes the HTML code of everything you see on the web, even if it is created by JavaScript.
An element can be disabled in HTML by setting disable property to true and enabled again by setting disabled=false.
I suggest to do it the "Lightbox"-style way.
Add an absolute positioned, transparent, full screen div Layer above the Page. This way, the user can't even click on a Link.
To give the user a visual feedback that the page is disabled, you can make the div e. g. 50% transparent black.
BTW, here is also a jQuery Plugin that uses a similar technique.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With