Javascript examples for jQuery:Text
JQuery set text with delay
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script type="text/javascript"> window.onload=function(){//from w w w .j a va 2s.co m $('#logout').click(function() { $(this).html('Waiting'); setTimeout(function() { $('#logout').html('Success'); }, 3000); }); } </script> </head> <body> <button type="button" class="list-group-item" id="logout"> Log out</button> </body> </html>