prevent text area from being focussed when div is displayed
I have div, which is set to "display: none" via css. When a user pushes a button I make the div visible
via .show(). The problem I'm having is that my iPhone 4S automatically focuses on the text area within this div when I show it and the iPhone's keyboard is displayed on the screen. Should using .show on the div bring the text area into focus? It doesn't seem like it should to me.
Here's the div, with display set to none:
- <div id="message_sender" style="display: none">
- <label for="messageText"><strong>Message:</strong></label>
- <textarea name="messageText" id="messageText"></textarea>
- <fieldset id="send_exit_buttons" class="ui-grid-a">
- <div id="exitChatButton" class="ui-block-a"><button data-theme="b">Exit</button></div>
- <div id="chatSendButton" class="ui-block-b"><button data-theme="b">Send</button></div>
- </fieldset>
- </div>
And here's the code snippet I'm using to show the div:
- $("#message_sender").show();
So my question is why does my iPhone 4S focus on the textarea and show the soft keyboard when I show the 'message_sender' div?
Thanks.