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 Answer 1
Simply
if ($('#myId').length) {
// div exists
}
Sign up to request clarification or add additional context in comments.
Comments
lang-js
how to know if a div with specific id exists using jqueryliterally gives you the right answer. Thanks!