jbel406
jbel406

Reputation: 116

Setting a boolean flag with JQuery click

I am trying to set a flag when a blockquote has been clicked. It does not appear to be working. Is isClicked considered Global, and if it is, is that not the correct way to change it from within a function?

$(document).ready(function() {
   $("blockquote").on("click", function() {
     setIsClicked();
   });
});

var isClicked = false;

function setIsClicked() {
   isclicked = true;
}

Upvotes: 0

Views: 3081

Answers (1)

dillonh
dillonh

Reputation: 35

It looks like your function is trying to change a different variable - "isclicked" vs "isClicked".

Upvotes: 1

Related Questions