javascript - row open on onclick event which is initially hidden -


i want open row on onclick event when particular link clicked. having number of row each row below having hidden row, when click row below row display.

code:

<script>             function toggle(number) {                 alert("toggle function called"+number);                 var simnum = number;                 if (document.getelementbyid(simnum).style.display = 'none') {                     document.getelementbyid(${dlist.simnumber}).style.display = '';                 } else {                     document.getelementbyid(${dlist.simnumber}).style.display = 'none';                 }             }          </script> <tr>                     <td></td>                     <td>${dlist.deviceaccount}</td>                     <td>${dlist.vehicleid}</td>                     <td><a href="#" onclick="toggle(${dlist.simnumber});">${dlist.simnumber}</a></td>                     <td>${dlist.imeinumber}</td>                     <td>${dlist.lasttimestamp}</td>                     <td>${dlist.lastlogintime}</td>                 </tr>                 <tr id="${dlist.simnumber}" style="display: none;">                     <td align="center" colspan="7">                         expiration time:<input id="read" type="text" value="${dlist.expirationtime}"/>                         <input type="button" value="edit"><input type="button" value="save">                     </td>                                 </tr> 

change javascript code

 function toggle(number) {                 alert("toggle function called"+number);                 var simnum = number;                 if (document.getelementbyid(simnum).style.display = 'none') {                     document.getelementbyid(simnum).style.display = '';                 } else {                     document.getelementbyid(simnum).style.display = 'none';                 }             } 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -