November 26, 201213 yr Hey so I currently have a row of images that each change the source of an image on my page to a different image and its href. Now What I also need each image to do is change the content of the div below each div so each image shows a different description. I've tried innerHTML but that doesn't sleep to work when you supply text such as <h3>TITLE</h3><p>TEXT HERE</p> as the text just doesn't display and obviously I want to use my CSS to style this text. Thanks
November 26, 201213 yr If you insert some tags with innerHTML , they will in fact show up. It's not really a clean way of doing it , but it's ok. Are you sure your script is working ? Léon
November 27, 201213 yr Yes, jQuery is the way forward for this. One simple line like $('#id_0f_the_div').html('<h3>TITLE</h3><p>TEXT HERE</p>'); is all you need Obviously you need to include the jQuery core file in your page but after that it makes things dead simple.
Create an account or sign in to comment