I’m not getting any errors in the following script, but I’m not seeing any change either. 😮
Anyone see my error? ?
My eyes must be going bad. 😮
[code=php]
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>
<html lang=”en”>
<head>
<title>Basic TAB display</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<script type=”text/javascript”>
var Info = new Array();
var str = ”;
str = “<h1>Tab Info #1</h1>”; Info[0] = str;
str = “<h2>Tab Info #2</h2>”; Info[1] = str;
str = “<h3>Tab Info #3</h3>”; Info[2] = str;
str = “Tab Info #4”; Info[3] = str;
str = “Tab Info #5”; Info[4] = str;
function Show(IDS) {
var ids; // alert(‘IDS: ‘+IDS);
for (i=0; i<Info.length; i++) {
ids = ‘btnTab’+i;
document.getElementById(ids).style.backgroundColor = “#FFFFFF”;
}
var N = IDS.charAt(-1); // alert(‘N: ‘+N);
document.getElementById(IDS).style.backgroundColor = “#FFFF00″;
document.getElementById(‘TabInfo’).innerHTML = Info[N];
}
</script>
<style type=”text/css”>
#TabInfo {
border: 1px solid blue;
height:200px;
width:300px;
}
</style>
</head>
<body>
<div>
<button id=”btnTab0′ onclick=”Show(this.id)”>Tab 1</button>
<button id=”btnTab1′ onclick=”Show(this.id)”>Tab 2</button>
<button id=”btnTab2′ onclick=”Show(this.id)”>Tab 3</button>
<button id=”btnTab3′ onclick=”Show(this.id)”>Tab 4</button>
<button id=”btnTab4′ onclick=”Show(this.id)”>Tab 5</button>
</div>
<div id=”TabInfo”></div>
</body>
</html>
Thanks for looking.