<p>The <code>end()</code> function in jQuery reverts the element set back to what it was before the last destructive change, so I can see how it's supposed to be used, but I've seen some code examples, eg: <a href="http://alistapart.com/articles/prettyaccessibleforms" rel="nofollow noreferrer">on alistapart</a> <em>(which were probably from older versions of jQuery - the article is from 2006)</em> which finished every statement off with <code>.end()</code>. eg:</p>

<pre><code>$( 'form.cmxform' ).hide().end();
</code></pre>

<ul>
<li>Does this have any effect?</li>
<li>Is it something I should also be doing?</li>
<li>What does the above code even return?</li>
</ul>

That
```
end()
```
doesn't do anything. There's no point to coding like that. It will return
```
$('#myBox')
```
-- the example is pretty poor. More interesting is something like this:
```
```
$('#myBox').show ().children ('.myClass').hide ().end ().blink ();
```
```
Which will show
```
myBox
```
, hide the specified children, and then blink the box. There are more interesting examples here:
http://simonwillison.net/2007/Aug/15/jquery/
such as:
```
```
$('form#login')
    // hide all the labels inside the form with the 'optional' class
    .find('label.optional').hide().end()
    // add a red border to any password fields in the form
    .find('input:password').css('border', '1px solid red').end()
    // add a submit handler to the form
    .submit(function(){
        return confirm('Are you sure you want to submit?');
    });
```
```