Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery toggle text on click

$(function(){
   $(".pushme").click(function () {
      $(this).text(function(i, text){
          return text === "PUSH ME" ? "DON'T PUSH ME" : "PUSH ME";
      })
   });
})
 
PREVIOUS NEXT
Tagged: #jquery #toggle #text #click
ADD COMMENT
Topic
Name
2+6 =