function hideDisplayTestsuites(textstring1, textstring2, tag) {
var myclass1 = new RegExp('\\\\b'+textstring1+'\\\\b');
if(textstring2 !=null){
var myclass2 = new RegExp('\\\\b'+textstring2+'\\\\b');
}
//Populate the array with all the page tags
var allPageTags=document.getElementById('test-results').getElementsByTagName("*");
//Cycle through the tags using a for loop
for (i=0; i<allPageTags.length; i++) {
//Pick out the tags with our class name
if (myclass1.test(allPageTags[i].className) || myclass2.test(allPageTags[i].className)) {
if (tag == 'hide'){
allPageTags[i].style.display = 'none';
}
else{
allPageTags[i].style.display = '';
}
}
}
}
problem is that it is a little slow implementation, so anybody have another faster implementation?I searched the web for jquery version of this, but coudnt find a logical exmplenation on how to use it. So if anyone sits on a link to a page where they describe how to do this in jquery I would be happy to recieve it
You can have global variable, but in jQuery when you add # in front of text than you get only one element with that id,
but if you use it without for example $(‘div’) than you get all divs on page, but if you want to get all divs with particular class
//if we are searching for divs with class=test
$('div.test').each(function(){
//your code
//example
$('this').css({display: 'none'});
});