<body>
<form action="">
Year: <input type="text" name="year">
<input type="submit" name="year" onClick="isLeapYear(this.year)"/>
</form>
</body>
怎样把<input type="text" name="year"> 中name="year"的值传递给onClick="isLeapYear(this.year)?谢谢了!!
<form action="">
Year: <input type="text" name="year">
<input type="submit" name="year" onClick="isLeapYear(this.year)"/>
</form>
</body>
怎样把<input type="text" name="year"> 中name="year"的值传递给onClick="isLeapYear(this.year)?谢谢了!!
解决方案 »
- 难道你没有遇到这样的问题吗?
- 请教:假如我想自己做个网站 运行在自己家里的服务器 具体需要什么样的步骤??
- 发现很多大站的资源如图片都是放在另一台服务器上的,美工在做页面编辑时怎么办?
- 很急!在线等!fileupload
- 于jndi配置数据库的一个非常奇怪的问题 急!急!!急!!!小弟在线等!!!!
- 请高手帮我看下为什么我的JSP文件无法调用js文件中的方法.谢谢
- 两个问题,请大家指教..都是WEBLOGIC和SQL SERVER的问题
- jbuilder8下如何装入安装j3d的包(从sun 下载的)在线等待!急!
- 菜鸟的问题
- hibernate查询不出数据
- JSP页面上数据导成EXCEL!急,跟普通的不太一样请认真看!
- Tomcat在Eclipse里启动时的问题?只有两行提醒,别的什么都没了
<form name='form1' action="">
Year: <input type="text" name="year">
<input type="button" value="获取year值" onClick="alert(document.all('year').value)"/>
</form>
</body>
<form action="">
Year: <input type="text" name="year" id="yearValue">
<input type="submit" name="year" onClick="isLeapYear(yearValue.value)"/>
</form>
</body>
<form action="" >
Year: <input type="text" name="year" id="year">
<input type="submit" name="year" onClick="alert(document.getElementById('year').value)"/>
</form>
</body>
<body>
<form action="" name="form1">
Year: <input type="text" name="year" id="year">
<input type="submit" name="submit1" onClick="isLeapYear()"/>
</form>
</body>
JS里代码
function isLeapYear()
{
var year_value=document.form1.year.value;
//下面是你具体的业务逻辑了
}