First, you need to change highlighted with: type="text/javascript" as it's deprecated:
Code:
<script language="JavaScript">
The problem is not on the doctype, but on your script.
You need not to use "eval()" if you want to get the element's ID prefixed with TR and the passed argument.
You can always use "document.getElementById()" and concatenate "tr" with the passed argument.
Migh help:
Code:
function disp1(id) {
var ObjDisplay = document.getElementById("tr"+id);
for (i=1;i<5;i++) {
document.getElementById("tr"+i).style.display="none";
}
ObjDisplay.style.display="block";
}
Bookmarks