Name an id dynamically with javascript?

Posted by jesse on Stack Overflow See other posts from Stack Overflow or by jesse
Published on 2010-03-17T23:07:55Z Indexed on 2010/03/17 23:11 UTC
Read the original article Hit count: 197

Filed under:
|

How can I dynamically name id's using javascript?

Something like this:

js:

var idName = "fruit";

html:

<img id="javascript:idName" src="banana.jpg">

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about id