8000 Change <span class="output">…</span> to <samp>…</samp> · jquery/api.jquery.com@7dfdc21 · GitHub
Skip to content

Commit 7dfdc21

Browse files
committed
Change <span class="output">…</span> to <samp>…</samp>
Closes #277
1 parent 0e4ebf3 commit 7dfdc21

27 files changed

Lines changed: 68 additions & 68 deletions

entries/bind.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ $('#bar').bind('click', function() {
100100
alert(message);
101101
});
102102
</code></pre>
103-
<p>Because the handlers are closures that both have <code>message</code> in their environment, both will display the message <span class="output">Not in the face!</span> when triggered. The variable's value has changed. To sidestep this, we can pass the message in using <code>eventData</code>:
103+
<p>Because the handlers are closures that both have <code>message</code> in their environment, both will display the message <samp>Not in the face!</samp> when triggered. The variable's value has changed. To sidestep this, we can pass the message in using <code>eventData</code>:
104104
</p>
105105
<pre><code>var message = 'Spoon!';
106106
$('#foo').bind('click', {msg: message}, function(event) {
@@ -111,7 +111,7 @@ $('#bar').bind('click', {msg: message}, function(event) {
111111
alert(event.data.msg);
112112
});
113113
</code></pre>
114-
<p>This time the variable is not referred to directly within the handlers; instead, the variable is passed in <em>by value</em> through <code>eventData</code>, which fixes the value at the time the event is bound. The first handler will now display <span class="output">Spoon!</span> while the second will alert <span class="output">Not in the face!</span>
114+
<p>This time the variable is not referred to directly within the handlers; instead, the variable is passed in <em>by value</em> through <code>eventData</code>, which fixes the value at the time the event is bound. The first handler will now display <samp>Spoon!</samp> while the second will alert <samp>Not in the face!</samp>
115115
</p>
116116
<blockquote>
117117
<p>Note that objects are passed to functions <em>by reference</em>, which further complicates this scenario.</p>

entries/blur.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ $('#target').blur(function() {
3737
});</code></pre>
3838
<p>Now if the first field has the focus, clicking elsewhere or tabbing away from it displays the alert:</p>
3939
<p>
40-
<span class="output">Handler for .blur() called.</span>
40+
<samp>Handler for .blur() called.</samp>
4141
</p>
4242
<p>To trigger the event programmatically, apply <code>.blur()</code> without an argument:</p>
4343
<pre><code>$('#other').click(function() {
4444
$('#target').blur();
4545
});</code></pre>
46-
<p>After this code executes, clicks on <span class="output">Trigger the handler</span> will also alert the message.</p>
46+
<p>After this code executes, clicks on <samp>Trigger the handler</samp> will also alert the message.</p>
4747
<p>The <code>blur</code> event does not bubble in Internet Explorer. Therefore, scripts that rely on event delegation with the <code>blur</code> event will not work consistently across browsers. As of version 1.4.2, however, jQuery works around this limitation by mapping <code>blur</code> to the <code>focusout</code> event in its event delegation methods, <a href="http://api.jquery.com/live/"><code>.live()</code></a> and <a href="http://api.jquery.com/delegate/"><code>.delegate()</code></a>.</p>
4848
</longdesc>
4949
<example>

entries/change.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<pre><code>$('#other').click(function() {
4343
$('.target').change();
4444
});</code></pre>
45-
<p>After this code executes, clicks on <span class="output">Trigger the handler</span> will also alert the message. The message will display twice, because the handler has been bound to the <code>change</code> event on both of the form elements.</p>
45+
<p>After this code executes, clicks on <samp>Trigger the handler</samp> will also alert the message. The message will display twice, because the handler has been bound to the <code>change</code> event on both of the form elements.</p>
4646
<p>As of jQuery 1.4, the <code>change</code> event bubbles in Internet Explorer, behaving consistently with the event in other modern browsers.</p>
4747
</longdesc>
4848
<example>

entries/click.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
});</code></pre>
4040
<p>Now if we click on this element, the alert is displayed:</p>
4141
<p>
42-
<span class="output">Handler for .click() called.</span>
42+
<samp>Handler for .click() called.</samp>
4343
</p>
4444
<p>We can also trigger the event when a different element is clicked:</p>
4545
<pre><code>$("#other").click(function() {
4646
$("#target").click();
4747
});</code></pre>
48-
<p>After this code executes, clicks on <span class="output">Trigger the handler</span> will also alert the message.</p>
48+
<p>After this code executes, clicks on <samp>Trigger the handler</samp> will also alert the message.</p>
4949
<p>The <code>click</code> event is only triggered after this exact series of events:</p>
5050
<ul>
5151
<li>The mouse button is depressed while the pointer is inside the element.</li>

entries/dblclick.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
});</code></pre>
4040
<p>Now double-clicking on this element displays the alert:</p>
4141
<p>
42-
<span class="output">Handler for .dblclick() called.</span>
42+
<samp>Handler for .dblclick() called.</samp>
4343
</p>
4444
<p>To trigger the event manually, apply <code>.dblclick()</code> without an argument:</p>
4545
<pre><code>$('#other').click(function() {
4646
$('#target').dblclick();
4747
});</code></pre>
48-
<p>After this code executes, (single) clicks on <span class="output">Trigger the handler</span> will also alert the message.</p>
48+
<p>After this code executes, (single) clicks on <samp>Trigger the handler</samp> will also alert the message.</p>
4949
<p>The <code>dblclick</code> event is only triggered after this exact series of events:</p>
5050
<ul>
5151
<li>The mouse button is depressed while the pointer is inside the element.</li>

entries/each.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
</code></pre>
2424
<p>A message is thus logged for each item in the list:</p>
2525
<p>
26-
<span class="output">0: foo</span>
26+
<samp>0: foo</samp>
2727
<br/>
28-
<span class="output">1: bar</span>
28+
<samp>1: bar</samp>
2929
</p>
3030
<p>You can stop the loop from within the callback function by returning <code>false</code>.</p>
3131
<p>Note: most jQuery methods that return a jQuery object also loop through the set of elements in the jQuery collection — a process known as <i>implicit iteration</i>. When this occurs, it is often unnecessary to <i>explicitly</i> iterate with the <code>.each()</code> method:</p>

entries/error.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</code></pre>
3232
<p>If the image cannot be loaded (for example, because it is not present at the supplied URL), the alert is displayed:</p>
3333
<p>
34-
<span class="output">Handler for .error() called.</span>
34+
<samp>Handler for .error() called.</samp>
3535
</p>
3636
<blockquote>
3737
<p>The event handler <em>must</em> be attached before the browser fires the error event, which is why the example sets the src attribute after attaching the handler. Also, the error event may not be correctly fired when the page is served locally; <code>error</code> relies on HTTP status codes and will generally not be triggered if the URL uses the <code>file:</code> protocol.</p>

entries/focus.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@
4444
});</code></pre>
4545
<p>Now clicking on the first field, or tabbing to it from another field, displays the alert:</p>
4646
<p>
47-
<span class="output">Handler for .focus() called.</span>
47+
<samp>Handler for .focus() called.</samp>
4848
</p>
4949
<p>We can trigger the event when another element is clicked:</p>
5050
<pre><code>$('#other').click(function() {
5151
$('#target').focus();
5252
});</code></pre>
53-
<p>After this code executes, clicks on <span class="output">Trigger the handler</span> will also alert the message.</p>
53+
<p>After this code executes, clicks on <samp>Trigger the handler</samp> will also alert the message.</p>
5454
<p>The <code>focus</code> event does not bubble in Internet Explorer. Therefore, scripts that rely on event delegation with the <code>focus</code> event will not work consistently across browsers. As of version 1.4.2, however, jQuery works around this limitation by mapping <code>focus</code> to the <code>focusin</code> event in its event delegation methods, <a href="http://api.jquery.com/live/"><code>.live()</code></a> and <a href="http://api.jquery.com/delegate/"><code>.delegate()</code></a>.</p>
5555
</longdesc>
5656
<example>

entries/get.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
<pre><code>($('li').get(0));</code></pre>
2727
<p>Since the index is zero-based, the first list item is returned:</p>
2828
<p>
29-
<span class="output">&lt;li id="foo"&gt;</span>
29+
<samp>&lt;li id="foo"&gt;</samp>
3030
</p>
3131
<p>Each jQuery object also masquerades as an array, so we can use the array dereferencing operator to get at the list item instead:</p>
3232
<pre><code>alert($('li')[0]);</code></pre>
3333
<p>However, this syntax lacks some of the additional capabilities of .get(), such as specifying a negative index:</p>
3434
<pre><code>alert($('li').get(-1));</code></pre>
3535
<p>A negative index is counted from the end of the matched set, so this example will return the last item in the list:</p>
3636
<p>
37-
<span class="output">&lt;li id="bar"&gt;</span>
37+
<samp>&lt;li id="bar"&gt;</samp>
3838
</p>
3939
</longdesc>
4040
<example>
@@ -78,4 +78,4 @@ $("*", document.body).click(function (e) {
7878
</example>
7979
<category slug="miscellaneous/dom-element-methods"/>
8080
<category slug="version/1.0"/>
81-
</entry>
81+
</entry>

entries/index.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ alert('Index: ' + $('li').index(listItem));
4040
We get back the zero-based position of the list item:
4141
</code></pre>
4242
<p>
43-
<span class="output">Index: 1</span>
43+
<samp>Index: 1</samp>
4444
</p>
4545
<p>Similarly, if we retrieve a jQuery object consisting of one of the three list items, <code>.index()</code> will search for that list item:</p>
4646
<pre><code>
@@ -49,7 +49,7 @@ alert('Index: ' + $('li').index(listItem));
4949
</code></pre>
5050
<p>We get back the zero-based position of the list item:</p>
5151
<p>
52-
<span class="output">Index: 1</span>
52+
<samp>Index: 1</samp>
5353
</p>
5454
<p>Note that if the jQuery collection used as the <code>.index()</code> method's argument contains more than one element, the first element within the matched set of elements will be used.</p>
5555
<pre><code>
@@ -58,7 +58,7 @@ alert('Index: ' + $('li').index(listItems));
5858
</code></pre>
5959
<p>We get back the zero-based position of the first list item within the matched set:</p>
6060
<p>
61-
<span class="output">Index: 1</span>
61+
<samp>Index: 1</samp>
6262
</p>
6363
<p>If we use a string as the <code>.index()</code> method's argument, it is interpreted as a jQuery selector string. The first element among the object's matched elements which also matches this selector is located.</p>
6464
<pre><code>
@@ -67,13 +67,13 @@ alert('Index: ' + listItem.index('li'));
6767
</code></pre>
6868
<p>We get back the zero-based position of the list item:</p>
6969
<p>
70-
<span class="output">Index: 1</span>
70+
<samp>Index: 1</samp>
7171
</p>
7272
<p>If we omit the argument, <code>.index()</code> will return the position of the first element within the set of matched elements in relation to its siblings:</p>
7373
<pre><code>alert('Index: ' + $('#bar').index());</code></pre>
7474
<p>Again, we get back the zero-based position of the list item:</p>
7575
<p>
76-
<span class="output">Index: 1</span>
76+
<samp>Index: 1</samp>
7777
</p>
7878
</longdesc>
7979
<example>

0 commit comments

Comments
 (0)