How can I get".some_button" in the code of the click function?

$('.Some_button').Click(function() {...

upd: object has a lot of classes

1 Answers 1

$(this) .attr('class');
  • The object will have a lot of classes, it won't roll it

    <div class='some_button class1 class2'></div>
    <div class='some_button class4 class3'></div>
    //Well, for example, active adds color to the button.
    $('.some_button').click(function() {
        $(this) .addClass('active');})
    //I need that by type
    $('.some_button').click(function(event) { !!.removeClass('active');
        $(this) .addClass('active');})
    – Comfortable83 Jul 21 '19 at 22:31
  • [[Paul_Morte]], I didn't understand anything, explain in a normal way what you need – Tame Thrush Jul 21 '19 at 22:57
  • I literally need to get the line'.some_button'- Text that I enter in $('here')

    $('.GET THIS CLASS').Click(function(event) {
    var classInput=some code should return me to'GET THIS CLASS'
    – Comfortable83 Jul 21 '19 at 23:53
  • [[Paul_Morte]], since you write the selector yourself, why do you need to receive it programmatically, if you know it? if you get it from a variable, well, use this variable inside the handler – Tame Thrush Jul 22 '19 at 00:08
  • [[StockholmSyndrome]],
    The question is simply the possibility of receiving.I search in the events - there is only a classist of the whole diva who was clicked :(
    – Comfortable83 Jul 22 '19 at 00:41
  • [[Paul_Morte]],
    The question is simply the possibility of getting

    the answer is simple - impossible
    but it is impossible because it is meaningless
    – Tame Thrush Jul 22 '19 at 01:08