Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#txt1").select();
- $("input[type=text]").focus(function() {
- $(this).select();
- });
- //code....
- $("#txt1").focus();
- //some code here to deselect the contents of this textbox
- $("input").focus(function(){
- this.selectionStart = this.selectionEnd = -1;
- });
- $("input[type=text]").focus(function() {
- if($(this).skipFocus) return;
- $(this).select();
- });
- //code....
- $("#txt1").skipFocus = true;
- $("#txt1").focus();
- $(your_input_selector).attr('disabled', 'disabled');
- $(your_input_selector).removeAttr('disabled');
- $(document).ready(function(){
- $('#txt1').focus(function(){
- setTimeout(function(){
- // set selection start, end to 0
- $('#txt1').attr('selectionStart',0);
- $('#txt1').attr('selectionEnd',0);
- },50); // call the function after 50ms
- });
- });
Add Comment
Please, Sign In to add comment