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>//给的例题
展开
 我来答
逆天子6云
2018-03-06
知道答主
回答量:22
采纳率:100%
帮助的人:9.4万
展开全部
<!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>
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式