jquery attribute manipulation(DOM manipulation) for input type text not working?
<p>in javascript below, variable <strong>temp</strong> would hold html string like this,</p>

<pre><code>&lt;input type="text" value="initial text" name="msg" /&gt;
</code></pre>

<p>why this code </p>

<pre><code>$('input[name=msg]').val('hello world');
</code></pre>

<p>won't change html string to</p>

<pre><code>&lt;input type="text" value="hello world" name="msg" /&gt;    
</code></pre>

<p>here is the code,</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form&gt;&lt;input type="text" value="initial text" name="msg" /&gt;&lt;/form&gt;

&lt;script type="text/javascript"&gt;
    $().ready(function(){
        $('input[name=msg]').val('hello world');

        var temp = $('form').html();

        console.debug(temp);        
    });
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>updated</p>

<pre><code>&lt;form&gt;
    &lt;input type="hidden" value="foo" name="msg1" /&gt;
    &lt;input type="text" value="bar" name="msg2" /&gt;
&lt;/form&gt;

&lt;script type="text/javascript"&gt;
    $(function(){
        $('input[name=msg1]').val('hello world 1'); // this manipulates dom at html level
        $('input[name=msg2]').val('hello world 2'); // this does not! why?

        $('form').html();
    });
&lt;/script&gt;
</code></pre>
