I have the following code:
$('.questionAlternative').change(function() {
var nestedQuestion = $(this).attr('nestedQuestion');
if(nestedQuestion != null || nestedQuestion != "") {
$("#"+nestedQuestion).show();
} else {
$(this).parent().next('.nestedQuestionContainer').hide();
}
}
The .questionAlternative is two radiobuttons, yes or no.
When I change to No, I get the following error:
Error: Syntax error, unrecognized expression: #
throw new Error( "Syntax error, unrecognized expression: " + msg );
I can't understand why. If nestedQuestion is empty, It should not go into the If-statement. But It seems like It doing It anyway?
"" != nullistrue