Getting reference to an image to set the align tag

J

james_crane

Hi,

I have an editable div. If I insert and image and explicity give it an
id I can reference it and change the tag thus...

var imgTag = document.getElementById("james")
imgTag.setAttribute('align','left')

However, I would like the user to be able to select the image, and then
have the align attribute set BUT I can;t get a reference to the image,

I have fiddled with
imgTag = document.selection.createRange()

but am failing - help woudl be appreciated

Thanks

James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top