Topic: changing css classes |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: |
![]() ![]() ![]() ![]() Hullo. code: <script type="text/javascript"> // ** Pages <div>isions handler script var divs = null; var links = null; function init(){ links = document.getElementById("menu").getElementsByTagName("a"); var tempDivs = document.getElementsByTagName("div"); for(i = 0; i<tempDivs.length; i++){ if(tempDivs[i].className == "serverBlock"){ alert(i); } } } window.onload = init; </script> |
Paranoid (IV) Inmate From: Madison, Indiana |
![]() ![]() ![]() ![]() |
Bipolar (III) Inmate From: |
![]() ![]() ![]() ![]() Intranet, NDA on the page content, and I am still striving with the domain name for publishing stuff |
Paranoid (IV) Inmate From: Umeå, Sweden |
![]() ![]() ![]() ![]() className is part of the DOM, every browser more recent than nn4 supports it |
Paranoid (IV) Inmate From: London |
![]() ![]() ![]() ![]() This may sounds silly, but does changing your for loop to the following help any? code: for(i = 0; i<tempDivs.length; i++){ var currentDiv = tempDivs[i]; if(currentDiv.className == "serverBlock"){ alert(i); } }
|
Bipolar (III) Inmate From: Missoula, MT |
![]() ![]() ![]() ![]() As far as finding reference docs in the future, a good place to start is msdn, where the pages include a "Standards Information" section near the bottom. |