hide / show based on a select value
Hi all,
I am trying to hide/show a div based on the value of a select element with id JobType.
As a test I use an alert to test this code but always, no matter what option is selected, get the alert.
This is my code:
$(document).ready(function() {
$("#JobType").change(function(){
if ($(this).attr('selectedIndex', 1))
alert("option 1")
})
});
Is there a way which would allow me to do that perhaps with the indexOf?
If so, how?
Tnx
D