javascript - Keeping a text field in focus -


i thought easy enough without seeking help, guess not. adding autofocus="true" tag works when page loads text field loses focus if clicks anywhere or opens link. how force field keep focus?

someone ask why want . answer of-course developers need deal crazy demands our clients :)

to answer:

$(document).ready(function(){      $(document).click(function() { $("<the-element>").focus() }); }); 

in case add listener elements in document :)


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -