How does one target all divs of any webpage but differentiate them in javascript?
Posted
by Chaz
on Stack Overflow
See other posts from Stack Overflow
or by Chaz
Published on 2010-06-07T01:58:23Z
Indexed on
2010/06/07
2:02 UTC
Read the original article
Hit count: 394
So I am trying to create an extension in Chrome (a prototype for a project that I am doing) that targets all of the <div>
tags of any web page, hides them or rather doesn't display them until the user clicks the mouse (further explained below). So typing a url into the browser yields a white page. The person clicks, and the first <div>
appears (probably the mast head or menu). The user clicks again and the second <div>
appears.
I have gotten to the point where I can hide or show all <div>
's (the obvious easy part) but I am not sure how to go about targeting each since every website has different id's for them while still using the <div>
tag. This is what I need the most help with.
This is part of a grander operation called the Web Crank. It's just a physical crank that controls the speed by which a web page loads. Each time you make one full rotation of the crank, one section (the first <div>
) of the web page loads. The faster you go, the quicker the page loads.
I hope this is clear enough. I am a newbie when it comes to this, but I have done some minor coding in the past and it's not such a big deal.
Thanks for your help!
© Stack Overflow or respective owner