Javascript working in chrome but not in explorer
- by Greg
Hello,
I am writing this code in html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript" type="text/javascript">
function setVisibility(id, visibility) {
document.getElementById(id).style.display = visibility;
}
</script>
<title>Welcome to the memory game</title>
</head>
<body>
<h1>Welcome to the memory game!</h1>
<input type="button" name="type" value='Show Layer' onclick="setVisibility('sub3', 'inline');"/>
<input type="button" name="type" value='Hide Layer' onclick="setVisibility('sub3', 'none');"/>
<div id="sub3">Message Box</div>
</body> </html>
It suppose to make the "div" disappear and reapper, but it works in chrome and not in explorer.
Anyone has any idea how can I make it work in explorer (I tried allowing blocked content when that message about activeX appears in explorer)?
Thanks,
Greg