jQuery - Choosing a variable based on the ID of the element that was clicked
<p>I'm probably overlooking a more obvious way to do what I want, but...</p>

<p>I have a list of JS variables with names that are identical to the ID's of some elements on my page. When I click one of the elmeents, I want to be able to use the clicked element's ID to determine which variable should be used in my function. My variable names correspond to my element ID's - there must be some way to take the value of my clicked element's ID using <code>$(this).id</code> and then find the variable that matches that string? Just to be clear, the content of the variables is not at all related to the variable names or element ID's - the variables are set when the page loads and I'd like to avoid setting them every time the function is run! And I know I could probably use <code>onclick</code> for this, but I'm trying to avoid that because apparently it's inferior now?!</p>

<p>Thanks!</p>
