Answers for "toggle span tag in jquery"

5

toggle text jquery

$("button").click(function(){
  $(this).text($(this).text() == 'Show' ? 'Close' : 'Show');
});
Posted by: Guest on January-21-2021
1

toggle attribute jquery

// Troggle attribute in jquery
$( selector ).attr('disabled', function(_, attr){ return !attr});
Posted by: Guest on May-14-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language