3 回答

慕哥9229398
TA贡献1877条经验 获得超6个赞
<script type="text/javascript">
$().ready(function(){
$("#myLabel").hover(function(){
$(this).text("已改");
},
function(){
$(this).text("未改");
});
});
</script>
...
<label id="myLabel">未改</label>
最好是把html函数改用text(),html是替换指定元素内的所有内容,而text()只会替换文字,假如你的myLabel中还设置有<span style='color:red'>Content</span>,那么使用text()函数最为合适

慕后森
TA贡献1802条经验 获得超5个赞
...
<script type="text/javascript">
$().ready(function(){
$("#myLabel").hover(function(){
$(this).html("已改");
},
function(){
$(this).html("未改");
});
});
</script>
...
<label id="myLabel">未改</label>
...
- 3 回答
- 0 关注
- 1051 浏览
添加回答
举报
0/150
提交
取消