Demo is here
I have a contenteditable div. I want the functionality in the div as follows:
When I click on red anchor tag, the new text that I will write will be
Please try this
$("#red,#blue").click(function () { $new = $("", { class: $(this).attr('id'), contenteditable : 'true' }) $("#my-contenteditable-div") .append($new) .children('div:last').focus(); }); DEMO 0 讨论(0) 查看其它5个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
DEMO