Adsense
Popular Posts
- Install APXS in Redhat Linux
- MySQL workbench -"Could not decrypt password cache"
- Transfer modules between sites
- JavaScript, remove trailing insignificant zeros after toFixed function
- Set Windows path command line
- datatable order by nunmeric
- MySQL date created and date modified
- super(props) in React
- PHP, dump varailbes in a format way
- React: connect(mapStateToProps, mapDispatchToProps)
Monday, June 15, 2015
Rendering HTML tags inside textarea
In textarea
var $mailform = $('<textarea id="textbody"><textarea>');
$mailform.find('#textbody').html("Dear <br />, This is advised that...");
We found html tags br is not rendered.
To sovle this problem, we make a div editable
var $mailform = $('<div id="textbody" class="editable"><div>');
$mailform.find('#textbody').html("Dear <br />, This is advised that...");
$('.editable').each(function(){
this.contentEditable = true;
});
Now this div has same feature as textarea.
Labels:
textarea
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment