
- jQuery Tutorial
- jQuery - Home
- jQuery - Overview
- jQuery - Basics
- jQuery - Syntax
- jQuery - Selectors
- jQuery - Events
- jQuery - Attributes
- jQuery - AJAX
- jQuery DOM Manipulation
- jQuery - DOM
- jQuery - Add Elements
- jQuery - Remove Elements
- jQuery - Replace Elements
- jQuery CSS Manipulation
- jQuery - CSS Classes
- jQuery - Dimensions
- jQuery - CSS Properties
- jQuery Traversing
- jQuery - Traversing
- jQuery - Traversing Ancestors
- jQuery - Traversing Descendants
- jQuery References
- jQuery - Utilities
- jQuery Plugins
- jQuery - Plugins
- jQuery - PagePiling.js
- jQuery - Flickerplate.js
- jQuery - Multiscroll.js
- jQuery - Slidebar.js
- jQuery - Rowgrid.js
- jQuery - Alertify.js
- jQuery - Progressbar.js
- jQuery - Slideshow.js
- jQuery - Drawsvg.js
- jQuery - Tagsort.js
- jQuery - LogosDistort.js
- jQuery - Filer.js
- jQuery - Whatsnearby.js
- jQuery - Checkout.js
- jQuery - Blockrain.js
- jQuery - Producttour.js
- jQuery - Megadropdown.js
- jQuery - Weather.js
- jQuery Useful Resources
- jQuery - Questions and Answers
- jQuery - Quick Guide
- jQuery - Useful Resources
- jQuery - Discussion
jQuery - Widget Button
Description
The Widget button function can be used with widgets in JqueryUI.Button is an input of type submit and an anchor.
Syntax
Here is the simple syntax to use Button −
$(function() { $( "input[type = submit], a, button" ) .button() .click(function( event ) { event.preventDefault(); }); });
Example
Following is a simple example showing the usage of Button −
<!doctype html> <html lang = "en"> <head> <meta charset = "utf-8"> <title>jQuery UI Button - Default functionality</title> <link rel = "stylesheet" href = "//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src = "//code.jquery.com/jquery-1.10.2.js"> </script> <script src = "//code.jquery.com/ui/1.11.4/jquery-ui.js"> </script> <script> $(function() { $( "input[type = submit], a, button" ) .button() .click(function( event ) { event.preventDefault(); }); }); </script> </head> <body> <button>A button element</button> <input type = "submit" value = "A submit button"> <a href = "#">An anchor</a> </body> </html>
This will produce following result −
jquery-widgets.htm
Advertisements