jQuery element’s tag name

Getting the selected element’s tag name is very easy in jQuery. Just use the below code.

See the Pen jQuery element’s tag name by John Tsevdos (@tsevdos) on CodePen

Keep in mind that by default the returned tag’s name is capitalized so if you want it lowercase you’ll need this :

See the Pen jQuery element’s tag name by John Tsevdos (@tsevdos) on CodePen

One thought on “jQuery element’s tag name”

Leave a Reply