<script type="text/javascript">
function sub(a){
a.style.background="#f00";
}
</script>
<div style="background:#ccc; width:100px; height:100px;" onclick="sub(this)"> </div> 传this..不用传ID
function sub(a){
a.style.background="#f00";
}
</script>
<div style="background:#ccc; width:100px; height:100px;" onclick="sub(this)"> </div> 传this..不用传ID
解决方案 »
- js实现动态菜单
- 我把一个写有JS的html复制到aspx中,在运行时网页错了,说是缺少对象,大家帮我看看
- uncaught exception: Invalid dimensions for plot, width = null, height = null,高手救
- ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●谁能帮忙分析一下Memoize这个函数的执行流程???有点不一般哦~~~~~~~~~~
- 如何让编辑器里的部分内容不可删除?
- html5中本地存储,如何存储图片文件?并且怎么显示该图片呢?
- jsp中onsubmit="return false;"但是表单还是提交了???
- 双击页面上的文字,怎么样让文字不被选中?
- 表单提交时, 如何保持iframe里面的内容不变?
- 如何删除二维数组中的某一行?
- 网页播放器异常捕捉
- jquery选择checkbox的问题,急 啊
document.getElementById("one"+a).style.background="#f00";
}