javascript 怎样传递element对象 怎样通过函数的参数传递element对象 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在函数内也可取到element呀,最简单的方法<span onclick="changColor(this)">aaa</span><script type="text/javascript">function changColor(elle){ elle.style.color="red";}</script> 事件源的方式<span onclick="changColorNoPointer(event)">aaa</span><script type="text/javascript">function changColorNoPointer(e){ //事件源 var elle = e.target || window.event.srcElement; elle.style.color="red"; }</script> 时间比较问题 jquery 根据Class怎么选择文本框? 为什么anchor: '96.7%', 在火狐中管用,在IE下不起作用那!!! 为什么这段代码 在ie7.0下 不能向上滚动啊 高手帮忙! ajax.xml的问题 js如何获取图片高度和宽度? 怎么样让网页输出一段信息,停几秒钟后再转向其它的网页? 子窗体刷新父窗口左框架 如何检查输入的用户名和密码里包含了空格? 用了node.js是不是就不需要tomcat和iis这类后台服务器程序了? 求教,有没有js插件或者jquery插件可以实现微博的社交关系图的? 关于js的正则表达式,真心求教
<span onclick="changColor(this)">aaa</span>
<script type="text/javascript">
function changColor(elle){
elle.style.color="red";
}
</script>
<script type="text/javascript">
function changColorNoPointer(e){
//事件源
var elle = e.target || window.event.srcElement;
elle.style.color="red";
}
</script>