So if we use the above code, all is working OK, as per alerts you see, but when we get to last line:
document.getElementById(box_id).appendChild(emo_elem);
then the Append does not happen. And there are NO JS errors in browser.
And if we replace document.getElementById(box_id).value
then we get JS Error form browser of:
document.getElementById(…).value.appendChild is not a function
The site that you provide us has a table structure and in its table data cells the code append div’s or other elements.Do you want to do this in your case?
911: Warning: A table row was 3 columns wide and exceeded the column count established by the first row (2).
912: Error: Table column 3 established by element td has no cells beginning in it.
gandalf, so that explains it.
That is if “The HTML textarea element represents a multi-line plain-text editing control.” then of course that is why it is not accepting a CSS DIV in there. That is a shame that one cannot add a DIV to a TextArea because that would open some interesting possibilities. Well I guess that is called pushing the limits of the current Web
If it did allow a div how do you suppose one would actually place the text"</div></div>" in the text area? A div or any other element for that matter. A better approach is to allow users to use markdown, bbcode, or an editor like ckeditor.