How to change the text on a button progamatically? |
You can use this code for change text on a button.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $(".content").text("Test"); }); }); </script> <h2 class="content">This is a heading</h2> <button>Click me to hide paragraphs</button> |
Welcome Guest, Not a member yet? Register Sign In |