当前位置:网站首页>Demo of throttling function -- regular expression matching
Demo of throttling function -- regular expression matching
2022-07-27 05:08:00 【Brave * Niuniu】
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<form>
<input type="text"><br/>
<span> Please enter </span>
</form>
<script> var input,flag,span; init(); function init(){
input = document.querySelector('input') span = document.querySelector('span') input.addEventListener('input',inputHandler); } function inputHandler(e){
if(flag) return flag = setTimeout(function(){
clearTimeout(flag); flag = undefined; disPaly(input.value); },500) } function disPaly(text){
if(text.match(/^1.+?0/)){
span.style.backgroundColor = 'green' span.innerHTML = ' correct ' }else{
span.style.backgroundColor = 'red' span.innerHTML = ' error ' } } </script>
</body>
</html>
边栏推荐
- Final Cut Pro中文教程 (2) 素材窗口的认识
- Photoshop各历史版本回顾以及系统要求
- 二、MySQL高级
- Complete Binary Tree
- "Photoshop2021 tutorial" adjust the picture to different aspect ratio
- Approval of meeting OA
- [untitled] I is circularly accumulated under certain conditions. The condition is usually the length of the loop array. When it exceeds the length, the loop will stop. Because the object cannot judge
- 对话框简介
- 标准对话框 QMessageBox
- 事件的接受与忽略
猜你喜欢
![[search] connectivity model of DFS + search order](/img/67/40444e53621371b1c8b47f22ebc956.png)
[search] connectivity model of DFS + search order

Review of various historical versions of Photoshop and system requirements

一、MySQL基础

Error: cannot read properties of undefined (reading 'then')

二叉搜索树详讲

如何重置Photoshop首选项?ps重置首选项的方法

事件(event)

集成开发环境Pycharm的安装及模板设置

QT 菜单栏、工具栏和状态栏

Transaction database and its four characteristics, principle, isolation level, dirty read, unreal read, non repeatable read?
随机推荐
Explanation of index failure principle and its common situations
Why is count (*) slow
kali系统arp介绍(断网嗅探密码抓包)
Installation and template setting of integrated development environment pychar
C中文件I/O的使用
Dialog introduction
Error: cannot read properties of undefined (reading 'then')
static和final关键字 学习 demo练习
Introduction to Web Framework
Photoshop提示暂存盘已满怎么办?ps暂存盘已满如何解决?
二维数组求和 练习
支付流程如何测试?
【搜索】—— 多源BFS + 最小步数模型
二、MySQL高级
【报错】Cannot read property ‘parseComponent‘ of undefined
[error reporting] cannot read property 'parsecomponent' of undefined
Photoshop各历史版本回顾以及系统要求
事件总结-常用总结
再一个技巧,每月稳赚3万+
Raspberry pie output PWM wave to drive the steering gear