0

I am working on a simple program which lets users to add some text when clicking on add text button. However, when user clicks again on the "add Text" button, a new text area should not be added instead the present textarea should be focused or if it is hidden, it has to be made visible.

This should be done using jquery.

any ideas ?

1
  • 5
    Hi, please always remember to Google first. Searching how to know if a div with specific id exists using jquery literally gives you the right answer. Thanks! Commented May 6, 2013 at 6:41

1 Answer 1

20

Simply

if ($('#myId').length) {
     // div exists
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.