0

How to Getting and Setting Image Attibute using javascript in HTML,

it's like generate image HTML Element using Javascript ?

anyone can help me ?

3
  • 3
    I have no idea what you mean. Commented May 9, 2014 at 13:25
  • Can you help us to help you first? Tell us more about what you want to do. What did you try? What did not work? Commented May 9, 2014 at 13:30
  • 1
    I am update my answer , sorry for bad my english I am new in stackoverflow and javascript, I hope with new update you can understand. Commented May 9, 2014 at 13:33

1 Answer 1

1

Recomended to read Documentation first.

var image = document.images[0];
var width = parseInt(image.getAttribute('WIDTH')); //for get attribute width of image
image.setAttribute("class","thumbnail"); //for setting attribute class of Image

here the documentation attributes of image

https://developer.mozilla.org/en/docs/Web/API/HTMLImageElement

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.