首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

jQuery JavaScript之安插表情后光标自动在表情字符的后

2012-10-17 
jQuery JavaScript之插入表情后光标自动在表情字符的后if(typeof document.selection ! undefined){//

jQuery JavaScript之插入表情后光标自动在表情字符的后

if(typeof document.selection !== "undefined"){//IE
???? $("#commentTextarea").focus();
???? document.selection.createRange().text = "insertText";
??? }else{
???? $("#commentTextarea").val($("#commentTextarea").val() + "insertText").focus();
??? }

就是这么简单!

热点排行
Bad Request.