Thursday 3 October 2013

jquery - Adding an additional variable to an if statement

jquery - Adding an additional variable to an if statement

I'm trying to add in an additional variable to an if statement but I'm
having trouble. #status refers to the id of a select, and 'student' is one
of the options. The code works fine without the additional && statement.
What am I doing wrong?
var status
$("#status").change(function() {
status = $(this).val();
});
$(function() {
$('#fb').flexbox(jobroles, {
onSelect: function() {
if(this.value==="Multi therapist" &&
$('#status').val()==="Student"){
$("#gdc").show();
}
else{
$("#gdc").hide();
}

No comments:

Post a Comment