textarea支持图形编辑的实现方法_javascript技巧 2020年6月13日 11:16:16js教程评论327 views阅读模式 代码 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title> New Document </title> </head> <body> <textarea id="editor" rows="13" cols="50">我的logo:</textarea> <script type="text/javascript" > var editor = document.getElementById('editor'); var img = document.createElement('img'); img.src = 'http://onewww.net/images/logo.jpg'; editor.appendChild(img); alert(editor.innerHTML); </script> </body> </html> [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] 点赞 登录收藏 https://www.qieseo.com/383398.html 复制链接 复制链接