Let's say I have the following HTML:
<div id="wrapper">
<div class="one">ONE</div>
<div class="two">TWO</div>
<div class="three">THREE</div>
</div>
If I have a click function as follows, how can I get the class name of the element that is clicked:
$(document).on('click', '#wrapper', function (event) {
// get class name
});
So if I was to click TWO
, it would return two
--
Just to add, the click handler would have to remain as #wrapper
, so essentially I need to get the child element that was clicked...