当我点击".pushme"按钮时,它将其文本变为"不要逼我".当再次点击按钮时,我想再次将文本转为"推我".我怎样才能做到这一点?
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<button class='pushme'>PUSH ME</button>
<script>
$(".pushme").click(function () {
$(this).text("DON'T PUSH ME");
});
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
谢谢.