I know this is simple, but I can't wrap my head around it. Currently the following code returns "[object HTMLDivElement],[object HTMLDivElement]" I'd like it to return "div1,div2". Any thoughts? Thanks guys.
<HTML>
<HEAD>
<script type="text/javascript" src="path_to/prototype.js"></script>
<script>
function linkClick ()
{
alert($$('div.basic'));
}
</script>
</HEAD>
<BODY>
<div id="div1" class="basic" onclick="linkClick();"></div>
<div id="div2" class="basic" onclick="linkClick();"></div>
</BODY>
</HTML>
I had the same problem, there is a simple solution :
If varElement is your object containing a [HTMLDivElement] (or other DOM object) simply add '.id'
e.g.
varElement.id