首页 > IT职业 > IT图书 > 点击A标签使其改变颜色
<script type="text/javascript">
$("a").click(function () { clearClass(); $(this).addClass("bg_color"); }); function clearClass() { $("a").each(function () { $(this).removeClass("bg_color"); }); }
</script>
<style type="text/css"> .bg_color { cursor:pointer;//鼠标显示效果,小手
color:Red;
font-weight:bold;//加粗
}</style>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4236/viewspace-2817003/ ,如需转载,请注明出处,否则将追究法律责任。