Thursday, 8 August 2013

Disable all control inside a div using javascript

 <script>
         function disableDiv(){
            document.getElementById("testdiv").disabled = true;
            var nodes = document.getElementById("testdiv").getElementsByTagName('*');
            for(var i = 0; i < nodes.length; i++){
                nodes[i].disabled = true;
            }
         }    
</script>

html
<div id="testdiv">

//your controls here !

</div>

No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...