I have made the following code in jsfiddle, and if I check the checkbox, the div Nime should be unhidden and vice versa , but it is not happening, what am I doing wrong?
Code in JSfiddle:
Html:
<label>Newspaper?</label>
<input type="checkbox" name="nieu" onclick="change()"><br/><br/>
<div id="nime">
<label>How?</label>
<select name="nime">
<option value="email">Email</option>
<option value="post">Post</option>
<option value="beide">Both</option>
</select>
</div>
Javascript:
function change(){
which = document.getElementById('nime');
if(which.style.display=="block"){
which.style.display="none";
}else{
which.style.display="block";
}
};