First of all I'd like to apologise in advance if I do not explain this very well, as I'm not overly familiar with javascript, but here we go.

I'm currently working on an ecommerce page on ebay, I've added html code within the description of a listing to make it look like an item in a shop.

However to do this I had to type in the title, link the image, etc all manually. To do this for every listing I have would take me years..

I then realised that the info I need is already at the top of the eBay page, where it is originally.

I want to repeat some of that information in the description box.

So, to do this more efficiently, I thought is there a way to use code like javascript to search the html of the page, for information stored between specific div tags e.g.

I want to search for the information between the div called "image"

"<div class="image"<a href="http://www.myimage.jpg"></a>></div>"

Then take that information and input it somewhere else, e.g. in the description where I want it.

Is this possible? If we can send people to the moon, then I'm sure it is. :)

Can anyone help me with this?

Much appreciated.

BB

I believe code similar code like this can retrieve the image:

document.getElementById('i_vv4-32').src;

However to write this out into the html I've come up with this:

document.write('<img src' + document.getElementById('i_vv4-31').src; + '/>');

But this does not work, I've probably missed something out? :S

Also the number "32" sometimes varies and can be 31 or 33 sometimes, does get.ElementById work if I try to look for part of an ID
e.g. just "i_vv4-"

Could really do with some help on this, thanks :|

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.