I was wondering if there is away to add a button below a textarea using jquery. I have generated html like below in power portals page.
<textarea rows="7" cols="20" maxlength="2000" id="description" class="textarea form-control "></textarea>
I would like to add a button just below it. I am using the code below but it is not displaying the button at all.
$(document).ready(function () {
$("#description").append("<button type='button' id='btnSave' class='btn'
style='color:#fff;background-color:#36f;border-color:36f;'
onclick='savefunction'>Save</button><br><br>");
});
You cannot put html inside textarea, you can only put text inside it. If you want to display a button within a text area, you can try appending the button on the parent of text area. and position the button accordingly.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.