<!DOCTYPE html><html><head><meta charset="utf-8"><title>菜鸟教程(runoob.com)</title><meta charset="utf-8"><script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script><script>$(document).ready(function(){ ???$("#ha").click(function(){ ???????$(this).removeClass("ccc"); ???????$(this).addClass("cc2"); ???????$(this).prop("disabled", true); ????????????});});</script> ???<style> ???????.ccc{ background: #d00000;} ???????.cc2{ background: #ed9d10;} ???????</style> ???????</head><body><button class="ccc" id="ha">添加和删除属性</button><br><br><div></div></body></html>
jQuery prop() 方法
原文地址:https://www.cnblogs.com/hahajava/p/9445462.html