【示例】
-
HTML
<!--省略-->
-
JS
$(document).ready(function(){ $("button").click(function(){ removeClassDelayed($("#id-p"),"pright","perror",1000); }); }); function removeClassDelayed(jqObj,cright,cerror,to){ setTimeout(function(){jqObj.removeClass(cright);},to); jqObj.addClass(cerror); }