how to know if a div with specific id exists using jquery -


this question has answer here:

i working on simple program lets users add text when clicking on add text button. however, when user clicks again on "add text" button, new text area should not added instead present textarea should focused or if hidden, has made visible.

this should done using jquery.

any ideas ?

simply

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

Comments