TypeError:document.today未定义 [英] TypeError: document.today is undefined

查看:110
本文介绍了TypeError:document.today未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<html>
<head></head>
<body>
<script type="text/javascript">
   document.today.value="hello";
</script>
     <input id="today" name="today"/>
</body>
</html>







怎么了?感谢您的帮助




what's wrong? thanks for your help

推荐答案

您的代码不正确。您应该在下一个示例中执行以下操作:

Your code is incorrect. You should do like in the next example:
<script type="text/javascript">


(文档)。 ready(function(){
(document).ready(function () {


(#today)。val(hello);
});
< / script >
("#today").val("hello"); }); </script>





在您的母版页(或页面布局)或页面中,您必须包含:



< script src =/ Scripts / jquery-1.5.2.min.jstype =text / javascript>< / script>



有关详细信息,请参见 http://jquery.com/! [ ^ ]


这篇关于TypeError:document.today未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆