I'm currently creating an element on a page dynamically to show image. I want to prevent more than one image being created at a time - so i figured I'd check for it's presence. A little scan of MSDN has given me getElementByName - but I don't know what methods / properties the returned collections has. I had a stab at .count (but no joy):
If someone could advise me on the best way of doing this and/or point me in the way of the relevent documentation, that would be great.Code:var iexists = document.getElementsByName('popupimg') alert(iexists.count) var i = document.createElement('img'); i.name = 'popupimg'




Reply With Quote