Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

toggle text jquery

$("button").click(function(){
  $(this).text($(this).text() == 'Show' ? 'Close' : 'Show');
});
Comment

jquery toggle text on click

$(function(){
   $(".pushme").click(function () {
      $(this).text(function(i, text){
          return text === "PUSH ME" ? "DON'T PUSH ME" : "PUSH ME";
      })
   });
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: usereducer hook react 
Javascript :: how to clear local storage 
Javascript :: jquery get id 
Javascript :: get document jquery 
Javascript :: ng class in angular 
Javascript :: javascript merge two objects 
Javascript :: changing color of console log 
Javascript :: prop-types 
Javascript :: adb bootloader reboot 
Javascript :: fetch post 
Javascript :: jquery close another dialog 
Javascript :: React does not recognize the `activeClassName` prop on a DOM element 
Javascript :: jquery summernote set value 
Javascript :: addclass jquery 
Javascript :: make contenteditable false javascript 
Javascript :: To append dropdown option using jquery 
Javascript :: on hover add class on children jquery 
Javascript :: jquery remove child 1 elemtn 
Javascript :: javascript check if is image 
Javascript :: javascript classlist add 
Javascript :: Confirm the Ending 
Javascript :: how to run curl in javascript 
Javascript :: npx create-react-app current folder 
Javascript :: js number with four decimal places 
Javascript :: javascript change hidden input value 
Javascript :: javascript infinite parameters 
Javascript :: js doubly linked list 
Javascript :: ckeditor get value 
Javascript :: reverse 179 in javascript 
Javascript :: vue js reload page 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =