nminaker
Technical User
- Jun 17, 2004
- 19
I have an onload event in the body that runs the following function:
The <td> tags' names are the same as the ID of the element that they should show. But when I just put in "this.name" in an alert box it shows "undefined"... Whats the problem?
Thanks!
Code:
function prepShowMsgs() {
var bqs = document.getElementsByTagName("blockquote");
for(i = 0; i < bqs.length; i++) {
var tds = document.getElementsByName(bqs[i].id);
for(j = 0; j < tds.length; j++) {
tds[j].onclick = function() {
document.getElementById(this.name).style.display = 'visible';
}
}
}
}
The <td> tags' names are the same as the ID of the element that they should show. But when I just put in "this.name" in an alert box it shows "undefined"... Whats the problem?
Thanks!