Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable all the elements in html

Tags:

How can we disable all the elements in html through javascript.The easiest way...

like image 908
Biju CD Avatar asked Aug 19 '09 06:08

Biju CD


People also ask

How do I disable an element in HTML?

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.).

How do I turn off elements on my website?

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.

How do I make a div inactive in HTML?

An element can be disabled in HTML by setting disable property to true and enabled again by setting disabled=false.


1 Answers

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.

like image 127
bjoernwibben Avatar answered Sep 22 '22 01:09

bjoernwibben