0
(高亮元素)我有這兩個功能:選擇刪除的KEYUP功能
var $mainEdit= $("#main-edit");
function getSelText()
{
var txt = '';
if (window.getSelection)
{
txt = window.getSelection();
}
else if (document.getSelection)
{
txt = document.getSelection();
}
else if (document.selection)
{
txt = document.selection.createRange().text;
}
else return;
return $("#clipboard").val(txt);
}
$mainEdit.mouseup(function(){
$("#clipboard").val("");
getSelText();
}).mousedown(function(){
$("#clipboard").val("");
getSelText();
});
我想要做的,是...突出顯示的元素將被刪除的keyup事件。
所以,如果我有這個網站:
<span>a</span>
<span>b</span>
<span>c</span>
,並強調了a和b,在keyup事件,第一個兩個跨將被刪除。