jquery text box carriage return and change events

Source: Internet
Author: User

text box changes with the Change event

To use BIND, the two are different, change is only when the loss of focus of time to start, many times can not meet the needs.

The code is as follows

$ (' #flowfromid '). Bind ("PropertyChange", function () {

Your content

});

text Box Carriage return event

The code is as follows

$ (document). Ready (function () {
$ ("#txt_JumpPager"). KeyDown (function (e) {
var curkey = E.which;
if (Curkey = = 13) {
$ ("#lbtn_JumpPager"). Click ();
return false;
}
});
});

Plus there are some like

$ ("#txtEmail"). Trigger ("focus"); text box gets focus when default

$ ("#txtEmail"). focus (function () {//text box to get focused event

It's all very useful.

  code is as follows &nbs P;

<input id= "username" type= "text"/>
<input id= "Pass" type= "Password"/>
<textarea id= "msg" rows= "2" cols= "></textarea>"
Example

< Script type= "Text/javascript"
    $ (function () {
         $ (": Input"). focus (function () {
               $ (this). AddClass ("Focus");
       }). Blur (function () {
              $ (this). Removeclass ("Focus");
       });
   })
</script>

Use: input to match all input elements, and when the focus is obtained, the style focuses are added, and the current element is automatically recognized by $ (this). The focus () method is the function that is taken when a focused event occurs. The blur () method is the function that is executed when the focus event occurs.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.