Click here to Skip to main content
15,844,498 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Good Evening,

How to make div enable and disable using javascript?

In my javascript function my method is
function Load()
{
var MultiLocation = document.getElementById("chkMultiLocations");

var divSubGroup = document.getElementById("divSubGroup");
document.getElementById("divSubGroup").disabled = true;
divSubGroup.innerHTML = "";
document.getElementById("divSubGroup").innerHTML = "";
divSubGroup.disabled = false;

}
and I have called this method in
<form id="frmGroupRegistration" onload="Load()" onsubmit="ValidateForm();" action="GroupRegistration.aspx" onscroll="true" method="post" >

It is not working
Please explain me withcode how to disable and enable div and its elements in html?

Thanks in advance
Posted

Check this out, one of them can be adapted to meet your need:
example
 
Share this answer
 
$("#divSubGroup *").attr("disabled", "disabled").off('click');
 
Share this answer
 
Comments
Faisalabadians 19-Dec-13 7:39am    
is it javascript?
Member 10434230 19-Dec-13 7:42am    
it is using jquery... if you are not using JQuery, change it to plain javascript
Member 8557048 19-Dec-13 7:57am    
Actually that is javascript method only but the method is not firing?
Faisalabadians 19-Dec-13 8:36am    
I just asked "$("#divSubGroup *").attr("disabled", "disabled").off('click');" is a javascript code? Did you read this "How to make div enable and disable using javascript?" ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900