jqueryhtmlcssjrubyonrails

What does this complicated jQuery selector mean?


What does this jQuery selector means?

button[data-remote]:not(form button), button[data-confirm]:not(form button)

Solution

  • The button element is being selected using these two selectors listed in the jQuery documentation:

    [HasAttribute] :not

    This basically means that:

    'button[data-remote]:not(form button)'
    

    is looking for all buttons with a data attribute of 'data-remote' that are not buttons inside of forms.

    The same logic goes for the other selector you listed as well.