What I'm trying to do: when an element with any class listed in an array is clicked, the class (and only that class) should be passed to a function.
I know well that the below is very incorrect, but I hope that it will illustrate what I am trying to accomplish:
var arr = ['.clickable-1', '.clickable-2', '.clickable-3', '.clickable-4', '.clickable-5'];
$(arr).click(function(){
alert('this class got clicked: ' + $(this).prop('class'));
});
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)