Hi there all :)
Made this nice little loop for hiding and showing div's, works as a charm in firefox and opera, but IE, safari and chrome say's no.... So my question is; why?
function theme(nr){
document.getElementById(nr).style.display = "block";
for (i = 0;i <= 28; i++) {
if (i != nr) {
document.getElementById(i).style.display = "none";
}
}
}
HTML:
<select id="subject" name="subject">
<option value="no" selected>Velg tema</option>
<option value="value0" onChange="javascript:theme(0)" onClick="javascript:theme(0)" onFocus="javascript:theme(0)">value0</option>
<option value="value1" onClick="theme(1)">value1</option>
</select>
<div class="tips" id="theme_0" name="theme_0">
<div class="tipsLabel">Tips:</div>
<div class="tipsContent">
lorem ipsum
</div>
<div class="tips" id="theme_1" name="theme_1">
<div class="tipsLabel">Tips:</div>
<div class="tipsContent">
more lorem ipsum
</div>
and so on...
Thanx:)