<input type="button" id="ggt" value="open" onclick="dawn()"/> <script type="text/javascript"> $(':button').click(function(){ $(this).val("close");}); </script>