[jQuery] Help with "if/else" statement

[jQuery] Help with "if/else" statement


Hello.
I can't quite figure out why the "cmtStatus" value is always "closed"
var cmtStatus = "Closed";
// toggle comment link
$("#postCmtBot").click(function() {
if (cmtStatus = "Open") { $("#postCmtBot").html("Hide Post
Comment"); cmtStatus = "Closed"; }
else { $("#postCmtBot").html("Post Your Comment"); cmtStatus =
"Open"; }
return false;
});
I expect that it would toggle back and forth between "Open" and
"Closed". Any idea what I'm doing wrong?
Thanks,
--shawn