We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c21b787 commit 55cb98cCopy full SHA for 55cb98c
1 file changed
entries/has-attribute-selector.xml
@@ -11,8 +11,10 @@
11
<desc>Selects elements that have the specified attribute, with any value. </desc>
12
<longdesc/>
13
<example>
14
- <desc>Bind a single click that adds the div id to its text.</desc>
+ <desc>Bind a single click to divs with an id that adds the id to the div's text.</desc>
15
<code><![CDATA[
16
+// Using .one() so the handler is executed at most once
17
+// per element per event type
18
$( "div[id]" ).one( "click", function() {
19
var idString = $( this ).text() + " = " + $( this ).attr( "id" );
20
$( this ).text( idString );
0 commit comments