Javascript examples for jQuery:Form Button
Toggle text of a button on click Jquery
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.js"></script> <script type="text/javascript"> $(window).load(function(){//from www. j a v a 2 s. co m $("#btnedit").click(function (e) { $(this).val("Edit" ? "Cancel" : "Edit"); }); }); </script> </head> <body> <input type="button" id="btnedit" value="Edit"> </body> </html>