Javascript examples for jQuery Selector:button
The :button selector selects button elements, and input elements with type=button.
The following code shows how to select <button> elements and <input> elements with type="button":
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $(":button").hide(); });// w w w .j a va 2 s . c om }); </script> </head> <body> <input type="button" value="Another button"><br> <h2>This is a heading</h2> <p>This is a paragraph.</p> <p>This is another paragraph.</p> <button>Click me</button> </body> </html>