Reputation: 10713
ARGH! What's wrong with this??
$(document).ready(function() {
var monkeyTrouble = $('#monkeyTrouble').attr('rel');
if (monkeyTrouble = "banana") {
alert("oooh oooh ahh ahhh");
}
});
Upvotes: -1
Views: 73
Reputation: 1321
well, if statement should be
if (monkeyTrouble == "banana")
note the "==".
Upvotes: 1
Reputation: 2120
Think you are looking for this...
if (monkeyTrouble == "banana") {
Hope that helps!
Upvotes: 6
Reputation: 138007
The condition is using =
, should probably be ==
:
if (monkeyTrouble == "banana")
Upvotes: 3