How to get classname of selected element in jquery

0
Our Reader Score
[Total: 0 Average: 0]
 jQuery .attr(): This article explain how to get class name or Fetch class name of element i.e Div, UL, li or any other HTML tag. You can also check my previous post on Learn jQuery, where have explained how to add click event on dynamically added element, and how to preview image before upload on server.

HTML:

Add div tags, with some class.

jQuery: code to get class name on button click

 


Get your Printable Copy

NO COMMENTS

LEAVE A REPLY