How to use javascript variables in jquery selectors
<p>How do I use the javascript variables as a parameter in a jquery selector?</p>

<pre><code>&lt;script type="text/javascript"&gt;

$(function(){    
    $("input").click(function(){
        var x = $(this).attr("name");
        $("input[id=x]").hide();    
    });    
});
&lt;/script&gt;

&lt;input type="text" id="bx"/&gt;&lt;input type="button" name="bx"/&gt;
&lt;input type="text" id="by"/&gt;&lt;input type="button" name="by"/&gt;
</code></pre>

<p>Basically what I want to do is to be able to hide the element which has id that is equal to the name of the element that is being clicked.</p>
