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!
    – Pekka
    Commented May 6, 2013 at 6:41

1 Answer 1

20

Simply

if ($('#myId').length) {
     // div exists
}
0

Not the answer you're looking for? Browse other questions tagged or ask your own question.