jquery選擇器$(this).find('input[type="submit"]:not(.cancel), button').click(function (){});

$(this).find('input[type="submit"]:not(.cancel), button').click(function (){});

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
$(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
  );
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章