Check if the clicked div id matches with variable
问题 I'm a coding newbie and looking for a way to check in jQuery whether the name of a certain variable corresponds to the ID of a div, and if so fire some code. Unfortunately, something about my syntax is off, and I can't figure out what. For a simple example, I want to click a div and store the ID of the div as a variable, and if I click it again the variable gets cleared. Simply assigning another boolean variable is not possible due to the rest of the code, I require the ID-check-thingy or