I'm checking a number of 'read more' links on my blog, and either hiding the link (for the first two posts), or hiding the content and keeping the link. I'm running the links' id
attributes through an if ... else
statement that looks like so:
$(document).find('.contentclicker').each(function(){
var pt = $(this).parent().attr('id');
if (pt == "postnum1" || "postnum2"){
$(this).hide();
}
else{
$(this).next().hide();
}
});
Note: There's some jQuery in there, but it's not relevant. I know from debugging that the var pt
is being set correctly to post_num_1, post_num_2, etc. - but when it evaluates post_num_3 and so on, it doesn't go to the else
. I've tried ==
and ===
, among other things, and I can't figure out what's wrong.
Any suggestions?