To get id of a selected class using jquery DOM use the function given below.
$(‘.test’).click(function() {
console.log(this.id);
});
In the above code test is the class name.
While using this.id we will be able to fetch id of that class
To get id of a selected class using jquery DOM use the function given below.
$(‘.test’).click(function() {