Skip to content

Commit 847d668

Browse files
committed
Intro to Effects: Fix generation of buttons.
1 parent 4df62ec commit 847d668

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

page/effects/intro-to-effects.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ end-users control over page animations by rigging a button they can click to sto
158158

159159
```
160160
// Create a button to stop all animations on the page:
161-
$( "input" ).attr({
162-
type: "button",
163-
value: "Stop All Animations"
164-
}).on( "click", function() {
165-
$( "body *" ).filter( ":animated" ).stop();
166-
}).appendTo( document.body );
161+
$( "<button type='button'></button>" )
162+
.text( "Stop All Animations" )
163+
.on( "click", function() {
164+
$( "body *" ).filter( ":animated" ).stop();
165+
})
166+
.appendTo( document.body );
167167
```
168168

169169
### `.delay()`
@@ -211,10 +211,10 @@ especially useful when dealing with older browsers; you also may want to
211211
provide the option to disable all animations to your users.
212212

213213
```
214-
$( "input" ).attr({
215-
type: "button",
216-
value: "Disable Animations"
217-
}).on( "click", function() {
218-
jQuery.fx.off = true;
219-
}).appendTo( document.body );
214+
$( "<button type='button'></button>" )
215+
.text( "Disable Animations" )
216+
.on( "click", function() {
217+
jQuery.fx.off = true;
218+
})
219+
.appendTo( document.body );
220220
```

0 commit comments

Comments
 (0)