Jquery Exclude a Selector?

后端 未结 5 2256
渐次进展
渐次进展 2021-02-14 22:00

I\'ve got a form that I clear on focus. I\'ve selected the whole form and it works great except that the submit button goes blank when I click it.

how can I exclude my i

5条回答
  •  旧巷少年郎
    2021-02-14 22:49

    Use .not() to exclude your input button (or buttons) from the set of inputs you already have.

    $('input.are.blong.to.us') // give me a bunch of inputs
        .not('#submit')        // exclude input#submit
        .focus( ... )          
        .blur( ... );
    

提交回复
热议问题