I’m trying to have a class call a function when it’s clicked but it’s not working.
$('.container_vragen').click(appendContainerVragenToContent_vragen);
with this code the function is called, but I want to call the action on .container_vragen only when it’s in the div #geregeld
$('.container_vragen' , '#geregeld').click(appendContainerVragenToContent_vragen);
And when I define that .container_vragen is inside #geregeld it does not call the function appendContainerVragenToContent_vragen
What’s the right selector for this?
The simple solution is to use the power of selectors :
But note that this won’t work if the DOM changes after you call. If you want to allow this, use