I'm looping through a form and showing content that matches my selected id's. The problem is that some divs contain more than one id in which case it stops working. Any ideas? Thanks.
Jquery Code:
$('#myForm').find('div').each(function() {
var myId = $(this).attr('id');
/* This will work */
if (myId == "Select1"){
$(this).removeClass("hideMe");
$(this).addClass("showMe");
}
/* This does not work */
else if (myId == "Select4"){
$(this).removeClass("hideMe");
$(this).addClass("showMe");
}
else{}
});
HTML Code:
<div class="hideMe" id="Select1">
<p>Some Content</p>
</div>
<div class="hideMe" id="Select2 Select3 Select4 Select5">
<p>Some Content</p>
</div>