Q
question.boy
I am trying to control the visibility of a set of div based on
selected values but can't seem to get it right. Below is what I have
so far but it does not work at all.
The basic concept was to have a set of Divs A through Z and by click
the associated text character that Div would be visible and all others
would be hidden.
<!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 HideAll() {
var DivName
//Loop through each lette of the alphabet
for (var i = 0; i < 26; i++) {
//document.write(String.fromCharCode(i+65)+" ");
//Hide the specified div
DivName = String.fromCharCode(i+65);
//alert(DivName);
//document.getElementById(''+DivName+'').style.display=='none';
document.getElementById('P').style.display=='none';
}
return false;
}
function ShowDiv() {
}
</script>
</head>
<body>
<div id="outerWrapper">
<div id="header">
<p></p>
</div>
<p><SPAN onclick="JavaScript: return HideAll();">A</SPAN>-B-C-D-E-F-
G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z</p>
</div>
</body>
</html>
On a side note, working with javascript, how does a professional
developer troubleshot functions etc? Are there any tools that permit
evaluating variable, placing code breaks, outputing error codes/desc.,
etc during execution?
Thank you so very much for the enlightenment!
QB
selected values but can't seem to get it right. Below is what I have
so far but it does not work at all.
The basic concept was to have a set of Divs A through Z and by click
the associated text character that Div would be visible and all others
would be hidden.
<!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 HideAll() {
var DivName
//Loop through each lette of the alphabet
for (var i = 0; i < 26; i++) {
//document.write(String.fromCharCode(i+65)+" ");
//Hide the specified div
DivName = String.fromCharCode(i+65);
//alert(DivName);
//document.getElementById(''+DivName+'').style.display=='none';
document.getElementById('P').style.display=='none';
}
return false;
}
function ShowDiv() {
}
</script>
</head>
<body>
<div id="outerWrapper">
<div id="header">
<p></p>
</div>
<p><SPAN onclick="JavaScript: return HideAll();">A</SPAN>-B-C-D-E-F-
G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z</p>
</div>
</body>
</html>
On a side note, working with javascript, how does a professional
developer troubleshot functions etc? Are there any tools that permit
evaluating variable, placing code breaks, outputing error codes/desc.,
etc during execution?
Thank you so very much for the enlightenment!
QB