JS 处理输入框表情
oninput input/textarea 监听输入状态
function filteremoji(content){
var ranges = [
'\ud83c[\udf00-\udfff]',
'\ud83d[\udc00-\ude4f]',
'\ud83d[\ude80-\udeff]'
];
emojireg = content .replace(new RegExp(ranges.join('|'), 'g'), '');
return emojireg;
}
$("input,textarea").on('input propertychange',function(){
var content=$(this).val();
var ranges = [
'\ud83c[\udf00-\udfff]',
'\ud83d[\udc00-\ude4f]',
'\ud83d[\ude80-\udeff]'
];
emojireg = content .replace(new RegExp(ranges.join('|'), 'g'), '');
$(this).val(emojireg);
})