js 通过 this 传 id
来源:互联网 发布:大拿监控软件下载 编辑:程序博客网 时间:2024/06/05 08:42
<script type="text/javascript">
function btn(a) {
alert(a ); // a相当于 document.getElementById('txt1')
var max= 9;
var min = 0;
if (a.value >= min && a.value <= max) {
a.style.backgroundColor = "red";
}
}
</script>
<body>
<form id="form1" runat="server">
<div>
<input type="text" runat="server" onchange="btn(this)" id="txt1" />
//this相当于 document.getElementById('txt1')
</div>
</form>
</body>
- js 通过 this 传 id
- js 通过 this 传 id
- 笔记 js通过this传id
- 通过实例全面解析JS中的This
- js使用this获取a标签id值
- web开发设计--JS学习之通过ID获取元素
- 通过js获取iframe的网址的ID号
- js中document通过ID获取的一些使用方法
- js通过正表达式获取链接参数id
- 通过一段代码简单说js中的this
- $(this).val()、this.id、$(this).attr(idCard)
- js如何根据id获取标签内的值,以及如何通过id赋值
- php js 通过sotitle(id,arr)函数输入ID取得返回值
- jquery&js $(this) & this
- js this
- JS this
- JS this
- js this
- 示例:DOS下串口通信源程序
- CSS里的 no-repeat 是什么意思
- XAML设置RadNumericUpDown的NumberFormatInfo
- mediawiki 1.21.1版本二次开发的问题集
- 细菌繁殖
- js 通过 this 传 id
- error:org.hibernate.LazyInitializationException: could not initialize proxy - no Session
- SecureCRT 实用配置
- 12) 类型安全的任意类CAnyObject [原创,泛型编程,自由下载转载,需注明出处]
- linux下的定时执行工具-直接用crontab命令编辑
- Android设备是否连接网络
- 高清屏2048x1536换普清屏1024x768调试
- config large memory
- rsync 取代 cp