jquery选择器$(this).find('input[type="submit"]:not(.cancel), button').click(functio

2019-06-19 11:24:44 浏览数 (1)

代码语言:javascript复制
$(this).find('input[type="submit"]:not(.cancel), button').click(function (){});
代码语言:javascript复制
Basically it is looking for elements located within this that has the following requirements

is an input
has type = submit
does not have a class of cancel
OR

is a button
代码语言:javascript复制
$(this)                   // within this jQuery object
  .find('                 // find all elements
    input[type="submit"]  // that are input tags of type "submit"
    :not(.cancel)         // and do not have the class "cancel"
    ,                     // or
    button                // are button elements
  ')
  .click(                 // and for each of these, to their click event
    function (){}         // bind this function
  );

0 人点赞