【发布时间】:2012-11-19 02:57:46
【问题描述】:
当我单击“.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>
谢谢。
【问题讨论】:
-
Jquery Toggle Text?的可能重复