javascript - Html style hidden for tables, td-s doesn't work well, just for div-s -


i hide , unhide part of html file. code use:

function changevisible(colorclass, mode){         var items = document.getelementsbyclassname(colorclass);             for(var i=0; < items.length; i++)              {                  if(mode == "0")                 {                   items[i].setattribute("style","");                   items[i].style.visibility = 'hidden';                 }                 else if(mode == "1")                 {                   items[i].setattribute("style","");                   items[i].style.visibility = 'visible';                   <!--items[i].style.display = 'none';-->                 }                                }             } 

the part select hideable parts:

function geturlparameters(variable, element){                var query = window.location.search.substring(1);                var vars = query.split("&");                (var i=0;i<vars.length;i++)                 {                        var pair = vars[i].split("=");                        if(pair[0] == variable)                        {                             <!-- document.getelementbyid("cxls").checked = pair[1]; -->                             if(pair[1] == "true")                             {                                 <!-- document.getelementbyid("cxls").checked = true; -->                                 document.getelementbyid(element).setattribute('checked', 'checked');                                 if(element == "cerr"){                                     changevisible("red", "1");                                 }                             }                             else if(pair[1] == "false"){                                 <!-- document.getelementbyid("cxls").checked = false; -->                                 document.getelementbyid(element).removeattribute('checked');                                 if(element == "cerr"){                                     changevisible("red", "0");                                 }                              }                         }                }                     }        

the problem is, works divs, table, or td not. suggestions?

problem solved. main problem wrong entry point.


Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -