单击回复按钮后 光标在@name的前面 请问怎样才能让光标在@name后面
js代码
$('.request-reply').on('click', function () { var othis = $(this), type = othis.attr('type'); $('.layui-form .quotepid').val(othis.attr('pid')); var val = $(window.frames["LAY_layedit_1"].document).find('body').val(); var aite = '@' + othis.attr('username').replace(/\s/g, ''); $(window.frames["LAY_layedit_1"].document).find('body').focus() $(window.frames["LAY_layedit_1"].document).find('body').append(aite+' ' + val); if(val.indexOf(aite) !== -1) return; $(window.frames["LAY_layedit_1"].document).find('body').val(aite +' ' + val); });
问题图片: