This question is the continuation of I created textarea expander from script but after, it doesn't expands
Because i create a table with the textarea and i want call the plugin textarea.
Calling after the appendTo with jQuery("textarea[class*=expand]").TextAreaExpander();
I searching all the textarea with class=”expand” and working.
How to edit this sentence for working only one div’s interest?
This question is the continuation of I created textarea expander from script but after,
Share
Assuming your structure is like this:
You can simply do this:
>is the child selector and#idselects the element with the given id.Edit
As @VijayVerma stated in the comments: If your
<div>doesn’t have an ID yet, just add the ID to the textarea instead:And select it with the ID-selector only:
If your <
div>s already have IDs, you’re fine with the first solution I’ve posted.