JQuery selector in variable
<p>I wanted to ask about using selector from a variable</p>

<p>first I have:</p>

<pre><code>function check()
{
  $('.info input, .info select').each(function(n, element){
     if ($(element).val()=='')
     alert('empty');
  });
}
</code></pre>

<p>and called it in</p>

<pre><code>$('input')change(check);
</code></pre>

<p>and they worked fine.</p>

<p>But now I want to pass some value to the function to make it dynamic, like</p>

<pre><code>$('input')change(check('.info'));
</code></pre>

<p>and changed the function to</p>

<pre><code>function check(sel) {   
     $(sel +' input, '+ sel + ' select').each(function(n, element){
     if ($(element).val()=='')
     alert('empty');   
  }); 
 }
</code></pre>

<p>but it doesn't work.
Any help please..
Thanks,</p>

<p>nagut</p>
