how could i pass a self object into a function and then use it?
like now, i have this:
Code:
<script>
function alertme(divid) {
	alert(divid.id);
}
</script>

<div id="testid" name="testname"><a name="linkname" href="javascript:alertme(parent)">text link</a></div>
so my idea was like if i could pass the parent of the link, which is the div object into the function call alertme and show the id of the div object. however this didn't seem to work. i got an empty alert box.

i have tried this, self and top instead of parent but all of those don't work either. moreover, i thought self may refer to the anchor tag object itself.

my idea doing this is so that i can save trouble going through the document.getElementById('testid').style..... which is very long. and having it able to pass itself into the function could make the function more dynamic and cater for not just one div but other div as well.

thanks!