Show and hide with javascript
<pre><code>    &lt;body&gt;
    &lt;input type="textbox" id="fname"&gt;&lt;/input&gt;
    &lt;button type="button" onclick="javascript:show('select'); return false;"&gt;Click&lt;/button&gt;&lt;/br&gt;
    &lt;input type="radio" id="select" style="display:none;"&gt;&lt;/input&gt;
&lt;/body&gt;
</code></pre>

<p>The code that i have written seems to be logical but in this case when i click the button it doesnt seem to be working .. Any any one tell me where could i have gone wrong </p>

<p>thanks in advance.</p>

<pre><code>    &lt;head&gt;
    &lt;title&gt;show and hide javascript&lt;/title&gt;
    &lt;script type="text/javascript"&gt;
        function show(id) {
            //alert("Its working");
            var myId = document.getElementById.id;
            if (myId.style.display = 'none') {
                myId.style.display = 'block';
            } else {
                myId.style.display = 'none';
            }

        }
    &lt;/script&gt;
&lt;/head&gt;
</code></pre>
