views:

46

answers:

1

For some reason... $("#thebutton").val("New text") doesn't work.

+1  A: 

Well, this works for me (tested on Chrome 4, FireFox 3.6, IE8):

<html>
<head>
    <title>Test</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <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">
    $(function() {
        $("#thebutton").val("New text");
    });
    </script>
</head>
<body>
    <input id="thebutton" type="submit" value="OK" />
</body>
</html>
Darin Dimitrov