# jQuery Mobile 按鈕圖標
jQuery Mobile 提供了一套讓按鈕看起來更稱心如意的圖標。

## 添加圖標到 jQuery Mobile 按鈕
如需添加圖標到您的按鈕,請使用 data-icon 屬性:
```
<a href="#anylink" data-role="button" data-icon="search">Search</a>
```
**提示:**您也可以在 <button> 或 <input> 元素上使用 data-icon 屬性。
下面我們列出一些 jQuery Mobile 提供的可用圖標:
| 屬性值 | 描述 | 圖標 | 實例 |
| :-- | :-- | :-- | :-- |
| data-icon="arrow-l" | 左箭頭 |
| data-icon="arrow-r" | 右箭頭 |
| data-icon="delete" | 刪除 |
| data-icon="info" | 信息 |
| data-icon="home" | 首頁 |
| data-icon="back" | 后退 |
| data-icon="search" | 搜索 |
| data-icon="grid" | 網格 |
如需查看所有 jQuery Mobile 按鈕圖標的完整參考手冊,請訪問我們的 [jQuery Mobile 圖標參考手冊](jquerymobile-ref-icons.html)。
## 定位圖標
您也可以規定圖標定位在按鈕的什么部位:頂部(top)、右側(right)、底部(bottom)、左側(left)。
請使用 data-iconpos 屬性來指定位置:
## 圖標的位置:
```
<a href="#link" data-role="button" data-icon="search" data-iconpos="top">頂部</a>
<a href="#link" data-role="button" data-icon="search" data-iconpos="right">右側</a>
<a href="#link" data-role="button" data-icon="search" data-iconpos="bottom">底部</a>
<a href="#link" data-role="button" data-icon="search" data-iconpos="left">左側</a>
```
> 
> 默認情況下,所有的按鈕圖標被放置到左側。
## 只顯示圖標
如果只想顯示圖標,請設置 data-iconpos 為 "notext":
## 后退:
```
<a href="#link" data-role="button" data-icon="search" data-iconpos="notext">搜索</a>
```
- jQuery Mobile 簡介
- jQuery Mobile 安裝
- jQuery Mobile 頁面
- jQuery Mobile 頁面切換
- jQuery Mobile 按鈕
- jQuery Mobile 按鈕圖標
- jQuery Mobile 工具欄
- jQuery Mobile 導航欄
- jQuery Mobile 可折疊塊
- jQuery Mobile 網格
- jQuery Mobile 列表視圖
- jQuery Mobile 列表內容
- jQuery Mobile 表單
- jQuery Mobile 表單輸入元素
- jQuery Mobile 表單選擇菜單
- jQuery Mobile 表單滑動條
- jQuery Mobile 主題
- jQuery Mobile 事件
- jQuery Mobile 觸摸事件
- jQuery Mobile 滾屏事件
- jQuery Mobile 方向改變事件
- jQuery Mobile Data 屬性
- jQuery Mobile 圖標
- jQuery Mobile 事件
- jQuery Mobile 頁面事件
- jQuery Mobile CSS 類
- 免責聲明