• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Working with html Nodes Re phrased

 
Ranch Hand
Posts: 52
1
MySQL Database Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All I want to do is to refer to the elements with the id= CatBreeds, DogBreeds and BirdBreeds
and then I want to make those nodes invisible.
I want to do this without refering to the id of these nodes
and I would like to do it using a loop

Here is a link to my current attempt to solve this problem
----------------------------------------------------------


[edited: to use code tags]
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I want to do this without refering to the id of these nodes



I wonder why don't you want to do this using the easiest way possible. Anyways, you can use the child elements property on an element to get all the child elements as node list and then iterate over it...
 
Stephen Black
Ranch Hand
Posts: 52
1
MySQL Database Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for that
The reason why I want to do things the hard way is becuause
Imagine if the list was not just a static list but imagine if it was a considerably long PHP generated database query
Thats why I believe the hard way (not referring to Id's) is the best way.

Anyhow after considerable experimentation I think I have it sorted out
The hardest thing about coding this is that it's hard to step throuht the script mentally
if you don't really understand fully the way the DOM is set out.

Ankit Garg wrote:

I want to do this without refering to the id of these nodes



I wonder why don't you want to do this using the easiest way possible. Anyways, you can use the child elements property on an element to get all the child elements as node list and then iterate over it...

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic