当前位置:网站首页>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>
边栏推荐
- The project connects with Alipay payment, and the intranet penetration realizes the monitoring of asynchronous callback notification of successful payment of Alipay
- Could not autowire.No beans of ‘userMapper‘ type found.
- What if Photoshop prompts that the temporary storage disk is full? How to solve the problem that PS temporary storage disk is full?
- 柔性数组以及常见问题
- Photoshop提示暂存盘已满怎么办?ps暂存盘已满如何解决?
- "Photoshop2021 tutorial" adjust the picture to different aspect ratio
- Use of file i/o in C
- kali系统arp介绍(断网嗅探密码抓包)
- The digital China Construction Summit ended with a list of massive pictures on site!
- Event Summary - common summary
猜你喜欢

再一个技巧,每月稳赚3万+

精选用户故事|洞态在聚水潭的误报率几乎为0,如何做到?

Translation of robot and precise vehicle localization based on multi sensor fusion in diverse city scenes

Introduction to dynamic memory functions (malloc free calloc realloc)

Solution: how to use bash batch command in win10

【牛客讨论区】第七章:构建安全高效的企业服务

MySQL storage engine and its differences

【报错】:Cannot read properties of undefined (reading ‘prototype‘)

Review of various historical versions of Photoshop and system requirements

Reproduce ssa-gan using the nine day deep learning platform
随机推荐
一道数学题,让芯片巨头亏了5亿美金
[search] flood fill and shortest path model
会议OA之我的审批
pyside2____1.安装和案列
Tcp server是如何一个端口处理多个客户端连接的(一对一还是一对多)
C中文件I/O的使用
OFDM 十六讲 2- OFDM and the DFT
OFDM 16 lecture 2-ofdm and the DFT
Another skill is to earn 30000 yuan a month+
Mysql表的约束
使用mq消息队列来进行下单流程的高并发设计,消息挤压,消息丢失,消息重复的产生场景和解决方案
strlen和sizeof的区别
feign调用丢失请求头问题解决及原理分析
DBUtils
What is the future development direction of software testing engineers?
QT menu bar, toolbar and status bar
Three paradigms, constraints, some keyword differences,
Replication of df-gan experiment -- detailed steps of replication of dfgan and forwarding from remote port to local port using mobaxtem
How does PS import LUT presets? Photoshop import LUT color preset tutorial
集成开发环境Pycharm的安装及模板设置