There is relatively little code.
The main ones are:
var log = [] ;
$(function () {
var txt = window.setInterval(function () {
if (log[log.length - 1] != $("#t").val() ) {
log[log.length] = $("#t").val();
}
}, 1500);
var isCtrl = false;
$(document ).keydown(function (e) {
if (e.which === 17)
isCtrl = true;
if (e.which === 90 && isCtrl === true) {
log.pop();
$("#t").val(log[log.length - 1]).blur();
}
}).keyup(function (e ) {
if (e.which === 17)
isCtrl = false;
});
});
Demo code:
If you need to introduce external Js, you need to refresh to execute ]
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn