why can't an element be accessed from the name attribute in Jquery
<p>what is the main reason  that we cannot access the element from its name attribute rather it can be accessed from id attribute</p>

<pre><code>&lt;input type="text" name="textname" id="textid" value=""&gt;
&lt;input type="button" name ="buttonname" id ="buttonid" value ="button"

$(document).ready(function(){
    $("#buttonid").click(function(){
        $("#textname").val ="text1";//doesnot  work 
        $("#textid").val ="text1";
    });
});
</code></pre>
