I have been struggling with following code. I can't get it to work. Please help. Thanks.
Code:
<html>
<head>
<script type="text/javascript">
function showhide(x) {
var el = id(x);
el.style.display=(el.style.display=='block')?'none':'block';
var y='<input name=a value=name onclick="return showIQ(' + "'89499F50000'" + ');">';
document.getElementById(x).innerHTML = y;
return false;
}
function showIQ(stkid) {
var stk = stkid.slice(0,5);
var x = 'S'+stkid.slice(6);
var el = id(x);
el.style.display=(el.style.display=='block')?'none':'block';
return false;
}
function id(x) {
if (typeof x == "string") return document.getElementById(x);
return x;
}
</script>
</head>
<body>
<a href="#" onclick="return showhide('F50000');">NAMES</a><br>
<div id="F50000" style="display:none;">
<div id="S50000" style="display:none;">ROBERT</div>
</div>
</body>
</html>