当我点击右键单击>粘贴时,我想从文本框中获取值.
$('#searchbox').bind('paste', function (e) {
alert($('#searchbox').val());
});
Run Code Online (Sandbox Code Playgroud)
那段代码没有完成我的解决方案.
尝试
$('#searchbox').bind('paste', function (e) {
setTimeout(getTextValue, 10);
});
function getTextValue() {
alert($('#searchbox').val());
}
Run Code Online (Sandbox Code Playgroud)