Quote:
Originally Posted by njfail
Out of curiousity, how would I add in things using JS?
Suppose I wanted to change the "tab4" text to something else?
|
To do that with ordinary JavaScript (without JQuery) you could use:
Code:
li = document.getElementsByClassName('ui-state-default');
len = li.length;
for (i = 0;i < len; i++) {
if (li[i].firstChild.href == '#tabs-4') {
li[i].firstChild.innerHTML = ';replacement text';
}
}
Note that assumes that all the <li> tags have an <a> tag as the first tag inside them so if some of them don't you'd need to add extra code to find the <a> tags. Also if you want it to work on really old browsers you'd need to add code to define getElementsByClassName.