Skip to content

Commit a71164b

Browse files
authored
All: Fix button selectors
A few selectors erroneously used `button)` instead of `button`. This has been fixed. Fixes gh-1226 Closes gh-1227
1 parent a8581e2 commit a71164b

24 files changed

+26
-26
lines changed

entries/bind.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ $( "p" ).bind( "myCustomEvent", function( e, myName, myValue ) {
221221
.fadeIn( 30 )
222222
.fadeOut( 1000 );
223223
});
224-
$( "button)" ).on( "click", function() {
224+
$( "button" ).on( "click", function() {
225225
$( "p" ).trigger( "myCustomEvent", [ "John" ] );
226226
});
227227
]]></code>

entries/data.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ $( "div" ).data( "options" ).name === "John";
111111
<example>
112112
<desc>Get the data named "blah" stored at for an element.</desc>
113113
<code><![CDATA[
114-
$( "button)" ).on( "click", function() {
114+
$( "button" ).on( "click", function() {
115115
var value;
116116
117117
switch ( $( "button" ).index( this ) ) {

entries/delay.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ $( "#foo" ).slideUp( 300 ).delay( 800 ).fadeIn( 400 );
4444
}
4545
]]></css>
4646
<code><![CDATA[
47-
$( "button)" ).on( "click", function() {
47+
$( "button" ).on( "click", function() {
4848
$( "div.first" ).slideUp( 300 ).delay( 800 ).fadeIn( 400 );
4949
$( "div.second" ).slideUp( 300 ).fadeIn( 400 );
5050
});

entries/delegate.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ $( "body" ).delegate( "p", "myCustomEvent", function( e, myName, myValue ) {
127127
.fadeIn( 30 )
128128
.fadeOut( 1000 );
129129
});
130-
$( "button)" ).on( "click", function() {
130+
$( "button" ).on( "click", function() {
131131
$( "p" ).trigger( "myCustomEvent" );
132132
});
133133
]]></code>

entries/dequeue.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<example>
1515
<desc>Use dequeue to end a custom queue function which allows the queue to keep going.</desc>
1616
<code><![CDATA[
17-
$( "button)" ).on( "click", function() {
17+
$( "button" ).on( "click", function() {
1818
$( "div" )
1919
.animate({ left:"+=200px" }, 2000 )
2020
.animate({ top:"0px" }, 600 )

entries/detach.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $( "p)" ).on( "click", function() {
1818
$( this ).toggleClass( "off" );
1919
});
2020
var p;
21-
$( "button)" ).on( "click", function() {
21+
$( "button" ).on( "click", function() {
2222
if ( p ) {
2323
p.appendTo( "body" );
2424
p = null;

entries/each.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<argument name="function" type="Function">
77
<desc>A function to execute for each matched element.</desc>
88
<argument name="index" type="Integer" />
9-
<argument name="element" type="Element" />
9+
<argument name="element" type="Element" />
1010
</argument>
1111
</signature>
1212
<desc>Iterate over a jQuery object, executing a function for each matched element. </desc>
@@ -106,7 +106,7 @@ To do list: <span>(click here to change)</span>
106106
<example>
107107
<desc>Use <code>return false</code> to break out of each() loops early.</desc>
108108
<code><![CDATA[
109-
$( "button)" ).on( "click", function() {
109+
$( "button" ).on( "click", function() {
110110
$( "div" ).each(function( index, element ) {
111111
// element == this
112112
$( element ).css( "backgroundColor", "yellow" );

entries/hide.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ $( "a" ).on( "click", function( event ) {
8282
<example>
8383
<desc>Animates all shown paragraphs to hide slowly, completing the animation within 600 milliseconds.</desc>
8484
<code><![CDATA[
85-
$( "button)" ).on( "click", function() {
85+
$( "button" ).on( "click", function() {
8686
$( "p" ).hide( "slow" );
8787
});
8888
]]></code>

entries/jQuery.dequeue.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<example>
1919
<desc>Use jQuery.dequeue() to end a custom queue function which allows the queue to keep going.</desc>
2020
<code><![CDATA[
21-
$( "button)" ).on( "click", function() {
21+
$( "button" ).on( "click", function() {
2222
$( "div" )
2323
.animate({ left: '+=200px' }, 2000 )
2424
.animate({ top: '0px' }, 600 )

entries/live.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ $( "p" ).live( "myCustomEvent", function( event, myName, myValue ) {
104104
.fadeIn( 30 )
105105
.fadeOut( 1000 );
106106
});
107-
$( "button)" ).on( "click", function() {
107+
$( "button" ).on( "click", function() {
108108
$( "p" ).trigger( "myCustomEvent" );
109109
});
110110
]]></code>

entries/nth-child-selector.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ $( "ul li:nth-child(2)" ).append( "<span> - 2nd!</span>" );
5353
<example>
5454
<desc>This is a playground to see how the selector works with different strings. Notice that this is different from the <a href="/even/"><code>even</code></a> and <a href="/odd/"><code>odd</code></a> which have no regard for parent and just filter the list of elements to every other one. The :nth-child, however, counts the index of the child to its particular parent. In any case, it's easier to see than explain so...</desc>
5555
<code><![CDATA[
56-
$( "button)" ).on( "click", function() {
56+
$( "button" ).on( "click", function() {
5757
var str = $( this ).text();
5858
var method = $( this ).attr( "data-method" );
5959
$( "tr" ).css( "background", "white" );

entries/nth-last-child-selector.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ $( "ul li:nth-last-child(2)" ).append( "<span> - 2nd to last!</span>" );
5151
<example>
5252
<desc>This is a playground to see how the selector works with different strings. </desc>
5353
<code><![CDATA[
54-
$( "button)" ).on( "click", function() {
54+
$( "button" ).on( "click", function() {
5555
var str = $( this ).text();
5656
$( "tr" ).css( "background", "white" );
5757
$( "tr" + str ).css( "background", "#ff0000" );

entries/nth-last-of-type-selector.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ $( "ul li:nth-last-of-type(2)" ).append( "<span> - 2nd to last!</span>" );
5252
<example>
5353
<desc>This is a playground to see how the selector works with different strings. </desc>
5454
<code><![CDATA[
55-
$( "button)" ).on( "click", function() {
55+
$( "button" ).on( "click", function() {
5656
var str = $( this ).text();
5757
$( "tr" ).css( "background", "white" );
5858
$( "tr" + str ).css( "background", "#ff0000" );

entries/prev.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ $( "li.third-item" ).prev().css( "background-color", "red" );
3434
<code><![CDATA[
3535
var $curr = $( "#start" );
3636
$curr.css( "background", "#f99" );
37-
$( "button)" ).on( "click", function() {
37+
$( "button" ).on( "click", function() {
3838
$curr = $curr.prev();
3939
$( "div" ).css( "background", "" );
4040
$curr.css( "background", "#f99" );

entries/remove.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ how are
6262
<example>
6363
<desc>Removes all paragraphs that contain "Hello" from the DOM. Analogous to doing <code>$("p").filter(":contains('Hello')").remove()</code>.</desc>
6464
<code><![CDATA[
65-
$( "button)" ).on( "click", function() {
65+
$( "button" ).on( "click", function() {
6666
$( "p" ).remove( ":contains('Hello')" );
6767
});
6868
]]></code>

entries/removeAttr.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ console.log( "onclick property: ", $element[ 0 ].onclick );
2222
<code><![CDATA[
2323
(function() {
2424
var inputTitle = $( "input" ).attr( "title" );
25-
$( "button)" ).on( "click", function() {
25+
$( "button" ).on( "click", function() {
2626
var input = $( this ).next();
2727
2828
if ( input.attr( "title" ) === inputTitle ) {

entries/replaceWith.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ $( "div.third" ).replaceWith( $( ".first" ) );
6969
<example>
7070
<desc>On click, replace the button with a div containing the same word.</desc>
7171
<code><![CDATA[
72-
$( "button)" ).on( "click", function() {
72+
$( "button" ).on( "click", function() {
7373
$( this ).replaceWith( "<div>" + $( this ).text() + "</div>" );
7474
});
7575
]]></code>

entries/show.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ $( "#clickme)" ).on( "click", function() {
6767
<example>
6868
<desc>Animates all hidden paragraphs to show slowly, completing the animation within 600 milliseconds.</desc>
6969
<code><![CDATA[
70-
$( "button)" ).on( "click", function() {
70+
$( "button" ).on( "click", function() {
7171
$( "p" ).show( "slow" );
7272
});
7373
]]></code>

entries/slideToggle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ $( "#clickme)" ).on( "click", function() {
6363
<example>
6464
<desc>Animates all paragraphs to slide up or down, completing the animation within 600 milliseconds.</desc>
6565
<code><![CDATA[
66-
$( "button)" ).on( "click", function() {
66+
$( "button" ).on( "click", function() {
6767
$( "p" ).slideToggle( "slow" );
6868
});
6969
]]></code>

entries/slideUp.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Click me!
8383
<example>
8484
<desc>Animates the parent paragraph to slide up, completing the animation within 200 milliseconds. Once the animation is done, it displays an alert.</desc>
8585
<code><![CDATA[
86-
$( "button)" ).on( "click", function() {
86+
$( "button" ).on( "click", function() {
8787
$( this ).parent().slideUp( "slow", function() {
8888
$( "#msg" ).text( $( "button", this ).text() + " has completed." );
8989
});

entries/toggle.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ $( "button" ).on( "click", function() {
105105
<example>
106106
<desc>Animates all paragraphs to be shown if they are hidden and hidden if they are visible, completing the animation within 600 milliseconds.</desc>
107107
<code><![CDATA[
108-
$( "button)" ).on( "click", function() {
108+
$( "button" ).on( "click", function() {
109109
$( "p" ).toggle( "slow" );
110110
});
111111
]]></code>
@@ -126,7 +126,7 @@ $( "button)" ).on( "click", function() {
126126
<desc>Shows all paragraphs, then hides them all, back and forth.</desc>
127127
<code><![CDATA[
128128
var flip = 0;
129-
$( "button)" ).on( "click", function() {
129+
$( "button" ).on( "click", function() {
130130
$( "p" ).toggle( flip++ % 2 === 0 );
131131
});
132132
]]></code>

entries/unwrap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<desc>Wrap/unwrap a div around each of the paragraphs.</desc>
1919
<code><![CDATA[
2020
var pTags = $( "p" );
21-
$( "button)" ).on( "click", function() {
21+
$( "button" ).on( "click", function() {
2222
if ( pTags.parent().is( "div" ) ) {
2323
pTags.unwrap();
2424
} else {

entries/val.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ $( "input[type=text].tags" ).val(function( index, value ) {
139139
<example>
140140
<desc>Set the value of an input box.</desc>
141141
<code><![CDATA[
142-
$( "button)" ).on( "click", function() {
142+
$( "button" ).on( "click", function() {
143143
var text = $( this ).text();
144144
$( "input" ).val( text );
145145
});

entries/visible-selector.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
$( "div:visible" ).on( "click", function() {
2525
$( this ).css( "background", "yellow" );
2626
} );
27-
$( "button)" ).on( "click", function() {
27+
$( "button" ).on( "click", function() {
2828
$( "div:hidden" ).show( "fast" );
2929
} );
3030
]]></code>

0 commit comments

Comments
 (0)