English 中文(简体)
(单位:千美元)
原标题:$(this).find( input[type="submit"]:not(.cancel), button ).click(function () - what is this?

谁能帮助我理解这一分类法?

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

I m对.cancel特别感兴趣,因为如果用户点击取消的纽顿,则用于验证一个页,而Im试图阻止验证。 我猜测上述编码线,他说,被点击的纽特是取消的纽特,然后继续。

但我不知道如何指定一个州为取消。

最佳回答

Basically it is looking for elements located within this that has the following requirements

  1. is an input
  2. has type = submit
  3. does not have a class of cancel

页: 1

  1. 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
  );

They re applying a CSS class named cancel to symbolize the cancel button basically (then checking it s a button with out this class)

Though 我不知道你可以使用星号(*)的星号。

Nevermind, 是你试图在代号范围内制定大胆的法典:

我也奇怪的是,他们为什么要取消任何途径,就提出取消的国歌。 (见<input category=“button”....../>将更为合适。)

.cancel is a class selector. Specifically it is looking for input elements with the type attribute set to submit, but don t have the cancel class. It also looks for elements with the tagName button.

You can "designate a button as cancel" like this:

<input type= submit  class= cancel  />

basically it is selector which says give me submit buttons without cancel class and buttons and apply click handler. try to look up the following selectors

tag .class :not





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...