Hey guys,
This is a fairly rookie question but I've not been able to find any information on it (mostly due to being clueless as to what keywords I'd need to search).
My issue is, put simply that if I generated a few div tags with an id or class attached and output it to a page I then want to be able to interact with those with javascript.
For example, I have a script that outputs this...
Code:
<div id="box1"><img src="image1.jpg" alt="" /></div>
<div id="box2"><img src="image2.jpg" alt="" /></div>
<div id="box3"><img src="image3.jpg" alt="" /></div>
<div id="box4"><img src="image4.jpg" alt="" /></div>
Now I want to use jQuery to fade out the opacity of box2, box3 and box4 but when I use the fade function in jQuery nothing happens and I get an error message that says it can't find box2, box3 or box4.
The question is, how can (if there is a way) you get javascript to interact with code that it has output into a page itself, or am I really off the scent and going about it completely the wrong way.
Hope someone can shed some light on this for me!
Cheers,
Leonard
|