To get the name of a class from jQuery

Asked 2 years ago, Updated 2 years ago, 35 views

<div class="myclass"></div> How do we get the name of this class if we have this kind of div?

javascript jquery

2022-09-22 22:08

1 Answers

var className = $('.myclass').attr('class'); Do it like this.


2022-09-22 22:08

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.