0
我试图从android设备的每个touchend事件的html页面中获取选定的文本,但无法获取选定的文本。Javascript-Android获取所选文本脚本
Javascript代码是:提前
if(window.getSelection)
{
t = window.getSelection();
}
else if(document.getSelection)
{
t = document.getSelection();
}
else if(document.selection)
{
t = document.selection.createRange().text;
}
感谢。
谢谢。当用户在Android设备上选择文本并获取所选文本时,我需要在JavaScript中触发一个事件。因为在按钮单击选择已经消失,所以我没有得到选定的文本。 – 2012-08-09 07:05:10