views:

38

answers:

1

For some reason $('#comment').html() returns the the default html, but any change to the text doesn't seem to be noticed after calling alert($('#comment').html());

   <form>
    <textarea id="comment" name="comment" rows="10" cols="60">input your comment</textarea><br />
    <div id="submit_comment">Submit Comment</div>
    </form>

    <script type="text/javascript"
    src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"&gt;&lt;/script&gt;

    <script type="text/javascript">
    $('#submit_comment').click(function() {
        alert($('#comment').html());
    });
    </script>

Edit I just noticed it is because you are supposed to use .val() not .html()

A: 

Sorry to answer my own question, It was a trivial mistake

use $('#comment').val() not $('#comment').html()

KennyCason