Im trying to get a function that writes elements with ID.
but i cant get It work.
this is what i have.
function createElementWithId(elementName, idName)
{
var id = document.createElement(elementName);
id.idName = idName;
return id;
}
Any ideas ?
Thanks.
You can set the id of an element by using
.idrather than.idName.Here is another example of someone using
id.