js里怎么做到在空白框输入一个A弹窗返回一个a其他值不予反应 5
<!DOCTYPEhtml><html><head><metacharset="utf-8"><title>首页配置</title><linkrel="styleshee...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>首页配置</title>
<link rel="stylesheet" href="./rescource/style.css">
</head>
<body>
<h1 class="title">首页配置</h1>
<!-- Banner start -->
<section class="box">
<div class="box-left">
<input type="checkbox" name="banner">
<label for="banner">BANNER:</label>
</div>
<div class="box-right">
<div class="config-banner">
<div class="banner-img">
<img width="200" height="98" src="./rescource/5a30ccdfN9a1fa29c.jpg!q70.jpg" alt="">
</div>
<div class="banner-config">
<div class="form-item">
<label>Banner名称:</label>
<input id="e" type="text" class="w150 mr15" >
<label>页面跳转:</label>
<select class="w100">
<option value="健康" selected>健康</option>
<option value="自定义">自定义</option>
</select>
</div>
<div class="form-item">
<label>H5地址:</label>
<input type="text" class="w250">
</div>
<div class="form-item">
<button type="button" class="button">修改图片</button>
<button type="button" class="button">上移</button>
<button type="button" class="button">下移</button>
<button type="button" class="button">删除</button>
</div>
</div>
</div>
<div class="submit-banner">
<button type="button" onclick="b()" class="button">添加Banner</button>
</div>
</div>
</section>
<!-- Banner end -->
</body>
</html>//给的例题 展开
<html>
<head>
<meta charset="utf-8">
<title>首页配置</title>
<link rel="stylesheet" href="./rescource/style.css">
</head>
<body>
<h1 class="title">首页配置</h1>
<!-- Banner start -->
<section class="box">
<div class="box-left">
<input type="checkbox" name="banner">
<label for="banner">BANNER:</label>
</div>
<div class="box-right">
<div class="config-banner">
<div class="banner-img">
<img width="200" height="98" src="./rescource/5a30ccdfN9a1fa29c.jpg!q70.jpg" alt="">
</div>
<div class="banner-config">
<div class="form-item">
<label>Banner名称:</label>
<input id="e" type="text" class="w150 mr15" >
<label>页面跳转:</label>
<select class="w100">
<option value="健康" selected>健康</option>
<option value="自定义">自定义</option>
</select>
</div>
<div class="form-item">
<label>H5地址:</label>
<input type="text" class="w250">
</div>
<div class="form-item">
<button type="button" class="button">修改图片</button>
<button type="button" class="button">上移</button>
<button type="button" class="button">下移</button>
<button type="button" class="button">删除</button>
</div>
</div>
</div>
<div class="submit-banner">
<button type="button" onclick="b()" class="button">添加Banner</button>
</div>
</div>
</section>
<!-- Banner end -->
</body>
</html>//给的例题 展开
1个回答
展开全部
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>首页配置</title>
<link rel="stylesheet" href="./rescource/style.css">
<script>
window.onload = function(){
var e = document.getElementById('e')
e.onkeyup= function(){
if(e.value.indexOf('A') != -1){
alert('a')
}
}
}
</script>
</head>
<body>
<h1 class="title">首页配置</h1>
<!-- Banner start -->
<section class="box">
<div class="box-left">
<input type="checkbox" name="banner">
<label for="banner">BANNER:</label>
</div>
<div class="box-right">
<div class="config-banner">
<div class="banner-img">
<img width="200" height="98" src="./rescource/5a30ccdfN9a1fa29c.jpg!q70.jpg" alt="">
</div>
<div class="banner-config">
<div class="form-item">
<label>Banner名称:</label>
<input id="e" type="text" class="w150 mr15" >
<label>页面跳转:</label>
<select class="w100">
<option value="健康" selected>健康</option>
<option value="自定义">自定义</option>
</select>
</div>
<div class="form-item">
<label>H5址:</label>
<input type="text" class="w250">
</div>
<div class="form-item">
<button type="button" class="button">修改图片</button>
<button type="button" class="button">移</button>
<button type="button" class="button">移</button>
<button type="button" class="button">删除</button>
</div>
</div>
</div>
<div class="submit-banner">
<button type="button" onclick="b()" class="button">添加Banner</button>
</div>
</div>
</section>
<!-- Banner end -->
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>首页配置</title>
<link rel="stylesheet" href="./rescource/style.css">
<script>
window.onload = function(){
var e = document.getElementById('e')
e.onkeyup= function(){
if(e.value.indexOf('A') != -1){
alert('a')
}
}
}
</script>
</head>
<body>
<h1 class="title">首页配置</h1>
<!-- Banner start -->
<section class="box">
<div class="box-left">
<input type="checkbox" name="banner">
<label for="banner">BANNER:</label>
</div>
<div class="box-right">
<div class="config-banner">
<div class="banner-img">
<img width="200" height="98" src="./rescource/5a30ccdfN9a1fa29c.jpg!q70.jpg" alt="">
</div>
<div class="banner-config">
<div class="form-item">
<label>Banner名称:</label>
<input id="e" type="text" class="w150 mr15" >
<label>页面跳转:</label>
<select class="w100">
<option value="健康" selected>健康</option>
<option value="自定义">自定义</option>
</select>
</div>
<div class="form-item">
<label>H5址:</label>
<input type="text" class="w250">
</div>
<div class="form-item">
<button type="button" class="button">修改图片</button>
<button type="button" class="button">移</button>
<button type="button" class="button">移</button>
<button type="button" class="button">删除</button>
</div>
</div>
</div>
<div class="submit-banner">
<button type="button" onclick="b()" class="button">添加Banner</button>
</div>
</div>
</section>
<!-- Banner end -->
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询