--- id: bad87fee1348cd8acdf08812 title: 創建一個 Bootstrap 按鈕 challengeType: 0 forumTopicId: 16811 dashedName: create-a-bootstrap-button --- # --description-- Bootstrap 的 `button` 元素有着獨有的、比默認 HTML 按鈕更好的樣式風格。 在較大的小貓圖片下方創建新的 `button` 元素。 爲它添加 `btn` 與 `btn-default` 兩個 classes 和 `Like` 文本。 # --hints-- 應創建一個新的包含 `Like` 文本的 `button` 元素。 ```js assert( new RegExp('like', 'gi').test($('button').text()) && $('img.img-responsive + button.btn').length > 0 ); ``` 新的按鈕元素應該有兩個 classes: `btn` 和 `btn-default`。 ```js assert($('button').hasClass('btn') && $('button').hasClass('btn-default')); ``` 確保所有 `button` 元素都有閉合標籤。 ```js assert( code.match(/<\/button>/g) && code.match(/ ``` # --solutions-- ```html

CatPhotoApp

Click here for cat photos.

A cute orange cat lying on its back. Three kittens running towards the camera.

Things cats love:

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats
```