InchesAway
04-14-2006, 09:46 PM
I have been working on this for a couple of days and I am not getting anywhere. I need to loop through the document, grab particular tags and create a list of the ids in these particular tags. I need to get the id for only the tags that have an id that starts with "pos".
For example, the tags I want to pull out look like:
<div id="pos-RCH" title="RCH"></div>
<div id="pos-SKY" title="SKY"></div>
<div id="pos-LDB" title="LDB"></div>
<div id="pos-PRO" title="PRO"></div>
I need to create a list that would look like: pos-RCH, pos-SKY, pos-LDB, pos-PRO.
I need to make this call as generic as possible because other people will be coding different ids but will have to follow the naming convention of "pos-" for the ids in the div tags.
I am assuming I need to do something like this:
var alldivs = document.getElementsByTagName("div");
for (var i = 0; i < alldivs.length; i++) {
//do something to create this list (pos-RCH, pos-SKY, pos-LDB, pos-PRO)
}
Please, if anyone can direct me, I would truly appreciate it.
For example, the tags I want to pull out look like:
<div id="pos-RCH" title="RCH"></div>
<div id="pos-SKY" title="SKY"></div>
<div id="pos-LDB" title="LDB"></div>
<div id="pos-PRO" title="PRO"></div>
I need to create a list that would look like: pos-RCH, pos-SKY, pos-LDB, pos-PRO.
I need to make this call as generic as possible because other people will be coding different ids but will have to follow the naming convention of "pos-" for the ids in the div tags.
I am assuming I need to do something like this:
var alldivs = document.getElementsByTagName("div");
for (var i = 0; i < alldivs.length; i++) {
//do something to create this list (pos-RCH, pos-SKY, pos-LDB, pos-PRO)
}
Please, if anyone can direct me, I would truly appreciate it.