The basic issue is that you are confusing variable names and their values.
"#auto" is a string.
If I declare a variable like:
var myString = "auto";
then notice that the variable myString contains the value, "auto".
In jQuery, you can get an element (a div in our example below) to manipulate by calling it with $("#auto") - meaning I want the element of the page that has been declared thus on the HTML page:
<div id="auto">...</div>
But since you can pass a string as an argument to the special $("#") function so that whatever follows the # gets grabbed from the page.
Therefore, instead of fixed and pre-determined arguments like $("#auto"), you can use $("#"+myString) from the example above to achieve the same result, but now by manipulating the value of myString you can do lots of things with the same $("#"+myString) without bothering about the exact element names over and again.