I'm not sure how to best word this, so I'll give it a shot and hopefully revise it as it comes to me.
Using javascript/jQuery, let's say I want to get some data from a clicked element to a function for processing. A couple of options:
OPTION 1:
$('.classOfInterest').click(function() {
// How can I get 'a' and 'b'?
var c = $(this).hasClass('cExists');
});
<a class="cExists classOfInterest" />
OPTION 2:
function processClick(string a, string b) {
// How can I get a reference to the calling element, similar to $(this) in the event handler?
var c; // here I want to determine whether the calling element has class 'cExists'
}
<a class="cExists" href="javascript:processClick('a', 'b')" />