To get the class of an element using jQuery you can use the snippet below.

var className = $('.myId').attr('class');

5 thought on “How to get the class of an element using jQuery”

Leave a Reply