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.