Wednesday, 21 January 2015

How to Collapse All Panels using JavaScript

<script type="text/javascript">

 function CollapseAll(Count)
 {
         for (i = 1; i <= Count; i++)
 {
             var obj = document.getElementById('ctl00_ContentPlaceHolder_ID' + i);
             if (obj.style.display != "none")
 {
                 document.getElementById('ctl00_ContentPlaceHolder_ID' + i).style.display = 'none';
                 document.getElementById('ctl00_ContentPlaceHolder_ID' + i).value = 'Collapse';
             }
         }
     }

 </script>

No comments:

Post a Comment