Using variables in function parameters, with or without Jquery
<p>I would like to write a function that I could reuse with different elements.</p>

<p>The idea is to get the window height and apply it to different elements.</p>

<p>I thought I could do something like this but it doesn't work: </p>

<pre><code>function autoHeight(element) {
  var height = window.innerHeight;
  $(element).css('height', height);
}

autoHeight('.dashboard-sidebar');
autoHeight('.some-element');
</code></pre>

<p>It doesn't work.  I know I'm close, but I'm missing something!</p>

<p>Thanks in advance!</p>