Thanks for all the help, I thought it might be something like that. I ended up just removing the other UL on the page and making them paragraphs so that the only ULs on the page were those I wanted to edit then used getElementByTagName.
Ok, so I have a very long hierarchical list that expands and collapses. To make the maintenance easier, I wrote some javascript to do the following:
1) Add the id content# where # starts at 0 and increases by 1 for each UL tag that will later be used to expand and collapse parts of the list...
ha, I am a fool. :)
Ok I solved this myself and in case anyone wanders through and wonders how...
I simply needed to simplify and use getElementsByName from the get go rather than by TagName and then trying to filter through those.
Sheesh...
Thanks anyway!
Ok, scratch that...
I can filter it by name (code at end of post), which works, but it does this (obviously not real code but the general gist):
<ul name="tree" id="content1">
<ul>
<ul>
<ul name="tree" id="content4">
<ul>
<ul name="tree" id="content6">
When I want...
<ul name="tree"...
Thanks that helped!!
Now, I am also trying to filter it by items that have a certain class. I have tried it and it doesn't seem to work.
Anymore brilliant ideas? :)
This is what I have (and various variations of)...
function addid() {
var g = document.getElementsByTagName('ul')...
I have a long list and the person that will be maintaining the site is NOT savvy at anything. So, I would like to write a function that will loop through all the UL elements and add an ID called "content#" where # starts at 0 and increases by 1 each time.
I have tried a number of things with...
Thanks so much for the input!
I ended up using css attribute selectors to add a little icon to all external links.
I definitely agree with the comments about not having any thing for external links. Unfortunately, I don't get the final say on such things. :(
Thanks for all the help!!
If...
I am a newbie to javascript. I work for an academic institution that can't really afford to hire real programmers so they are asking us to do our best. I manage a large site (5000+ pages).
Recently, one of the "higher-ups" decided that we should have a notification BEFORE someone clicks a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.