jQuery - Bouton Widget

La description

le Widget button La fonction peut être utilisée avec des widgets dans JqueryUI.Button est une entrée de type submit et une ancre.

Syntaxe

Voici la syntaxe simple pour utiliser Button -

$(function() {
   $( "input[type = submit], a, button" )
   .button()
   .click(function( event ) {
      event.preventDefault();
   });
});

Exemple

Voici un exemple simple montrant l'utilisation de 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>

Cela produira le résultat suivant -

jquery-widgets.htm