I am trying to set focus to the input text field with id=”message-add” when it is showed using jQuery. I think i should use ‘live()’ or ‘delegate’ and the function focus() to get it to work? Which should be used and how should it be written?
$("#message-add").show();
$("#message-add").focus();
Here is one way to do it, if the
inputis hidden, which is what I think the Q is stating?http://jsfiddle.net/jasongennaro/FhB8u/