jquery don't (or remove) focus on any form field [duplicate]
Possible Duplicate:
Jquery Unfocus
Have a form with just one password field tag, and as I use palceholder, I don't want to have automatic 开发者_如何转开发input focus. How can I set no focus at all within jquery?
Thanks, Markus
I'm not fully clear on what you need, but I think you're looking for something like this:
$("input").blur();
That will remove the focus from any input
element that may have it.
You can disable the field. $('input.my-input').attr('disabled', true);
Then re-enable it when you want to allow input (on click or whatever). You'd have to use some CSS (.my-input:disabled { ... }
) to make sure the browser doesn't grey it out.
精彩评论