Jump to content

display this result for each


toolman

Recommended Posts

Hi,

 

I have the following code which grabs the file name of an image and then displays the result inside a div with an ID

 

However, what I want to do is to display the result in every div on the page with a class of .image. How would I do this?

 

Thanks!

 

 

 

var pcode = $('.image img').attr('src').replace(/\.jpg/, '').split('/').slice(-1);
document.getElementById('prod').innerHTML += pcode;

Link to comment
https://forums.phpfreaks.com/topic/287254-display-this-result-for-each/
Share on other sites

  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.