dropdown hide show, jQuery

Hide select then show on select drop down box change. Contact form 7.

[select menu-817 id:menu-817 "doctor 1" "doctor 2"]
[select menu-634 id:menu-634 "nurse 1" "nurse 2"]
[select menu-635 id:menu-635 "medic 1" "medic 2"]

 




function hide() {
	var earrings = document.getElementById('menu-634');
	earrings.style.visibility = 'hidden';
}

function show() {
	var earrings = document.getElementById('menu-634');
	earrings.style.visibility = 'visible';
}

jQuery(document).ready(function(){
	hide();

	jQuery("#menu-817").change(function() {
      this.options[this.selectedIndex].value;
 	    var strUser = this.selectedIndex;
   		console.log('strUser: ' + strUser);

	  	if (strUser == "1") {
		  show();
	  	}
	});

});

Advertisements