Book Image

jQuery Mobile First Look

Book Image

jQuery Mobile First Look

Overview of this book

Table of Contents (17 chapters)
jQuery Mobile First Look
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Buttons markup and icons


There is, of course, only one way in which we are able to display a working button on a web page. However, there are a number of options we are allowed to apply to our buttons to further customize, change, or tweak their appearance and/or functioning.

Creating link buttons

These are the most straightforward buttons to create and place anywhere in a page.

Due to the nature of links though, they'd be better used exclusively for navigation purposes, whereas form buttons are better suited for, well, forms!

  1. In the main content block of a page, we first need to have an anchor link element we want to turn into a button:

    <a href="somewhere.html">Click me!</a>
  2. We can now add a data-role="button" attribute to the link: jQuery Mobile will do the rest and add the necessary styling to the link.

    <a href="somewhere.html" data-role="button">Click me!</a>
  3. And that's it; we already have a button we can click to navigate through our website. Adding a data-role="button...