How to disable all div content

0 votes
I was under the assumption that if I disabled a div, all content got disabled too.

However, the content is grayed but I can still interact with it.

Is there a way to do that?
Aug 25, 2020 in Java-Script by kartik
• 37,520 points
21,911 views

1 answer to this question.

0 votes

Hello @kartik,

A simple way to disable any DIV including its contents is to just disable mouse interaction. 

For example:

$("#mydiv").addClass("disabledbutton");

css

.disabledbutton {
    pointer-events: none;
    opacity: 0.4;
}

Hope it works!!

Thank you!!

answered Aug 25, 2020 by Niroj
• 82,840 points

Related Questions In Java-Script

0 votes
1 answer

How jQuery event to trigger action when a div is made visible?

Hello @kartik, You could always add to the ...READ MORE

answered Aug 25, 2020 in Java-Script by Niroj
• 82,840 points
10,530 views
0 votes
1 answer

How to replace all occurrences of a string?

Hello @kartik, As an alternative to regular expressions ...READ MORE

answered Aug 28, 2020 in Java-Script by Niroj
• 82,840 points
869 views
0 votes
1 answer

How can I make a div stick to the top of the screen once it's been scrolled to?

Hello @kartik, Using javascript: var initTopPosition= $('#myElementToStick').offset().top; ...READ MORE

answered Sep 4, 2020 in Java-Script by Niroj
• 82,840 points
851 views
0 votes
1 answer

How to adjust width and height of iframe to fit with content in it?

Hello @kartik, <script type="application/javascript"> function resizeIFrameToFitContent( iFrame ) { ...READ MORE

answered Sep 4, 2020 in Java-Script by Niroj
• 82,840 points
7,398 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
23,094 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
3,019 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
2,951 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
44,896 views
0 votes
1 answer

How to clear all <div>s’ contents inside a parent <div>?

Hello @kartik, jQuery's empty() function does just that: $('#masterdiv').empty(); clears the master div. $('#masterdiv ...READ MORE

answered Oct 7, 2020 in Java-Script by Niroj
• 82,840 points
1,022 views
+1 vote
2 answers

How to convert entire div data into image and save it into directory without using canvas?

Hello @kartik, You can try the sample code ...READ MORE

answered Apr 29, 2020 in Java-Script by Niroj
• 82,840 points
73,077 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP