PHP Code:
document.getElementsByClassName = function(cl) {
var 
retnode = [];
var 
myclass = new RegExp('\\b'+cl+'\\b');
var 
elem this.getElementsByTagName('*');
for (var 
0elem.lengthi++) {
var 
classes elem[i].className;
if (
myclass.test(classes)) retnode.push(elem[i]);
}
return 
retnode;
};

function 
change(id){
     
ID document.getElementsByClassName(id);
    
     if(
ID.style.display == "")
          
ID.style.display "none";
     else
          
ID.style.display "";
      } 
i am trying to show/hide based on the class...but the above code is giving me error:

ID.style has no properties

this is how html displays...

<tr id="2" style="display: none;">a</tr>
<tr id="2" style="display: none;">b</tr>

.....onclick="change(2)"