如何获取表单中的P元素? <input>元素外面套了一个<p>元素,如果用javascript获取这个p元素? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!DOCTYPE HTML><html> <head> <meta charset="gb2312" /> <title></title> </head> <body> <p id="test"> <input type="button" value="click" onclick="alert( this.parentNode.id )" /> </p> </body></html> <html><head><title>Upload File</title></head><body><form name="myForm" action="#" method="post"> <label for="uploading_file"><strong>File Uploading:</strong></label> <p><input type="file" name="uploading_file" id="uploading_file"></p> <input type="button" value="-" onclick="decreasing_quantity()"> <input type="text" name="quantity" maxlength="2" size="2" value="0""/> <input type="button" value="+" onclick="increasing_quantity()"> <input type="submit" value="Submit Files"></form></body></html>那个<p>标签是在<form>里面的,如何在javascript里面通过DOM获取? <html><head><title>Upload File</title></head><body><form name="myForm" action="#" method="post"><label for="uploading_file"><strong>File Uploading:</strong></label><p><input type="file" name="uploading_file" id="uploading_file"></p><input type="button" value="-" onclick="decreasing_quantity()"><input type="text" name="quantity" maxlength="2" size="2" value="0""/><input type="button" value="+" onclick="increasing_quantity()"><input type="submit" value="Submit Files"></form><script> alert( document.getElementById('uploading_file').parentNode )</script></body></html> 怎么让文本框点进去不显示外面的高亮框 关于jquery ajax 简单的问题 求指教 JS函数被触发的时候,如何获得触发该函数的标签? 得到表格中的行数 这段代码倒计时速度太慢,哪里出问题了。 求树型目录的管理界面截图 javascript里的$符号是什么意思? ~~求助javascript问题,急~~ 这个页面的效果是不是用JavaScript做的? 判断输入非空的问题! 仿51job那种城市选择的弹出层 能实现多层么? JS实现类似excel的表格数据输入,并自动计算的页面
<!DOCTYPE HTML>
<html>
<head>
<meta charset="gb2312" />
<title></title>
</head>
<body>
<p id="test">
<input type="button" value="click" onclick="alert( this.parentNode.id )" />
</p>
</body>
</html>
<head>
<title>Upload File</title>
</head>
<body>
<form name="myForm" action="#" method="post">
<label for="uploading_file"><strong>File Uploading:</strong></label>
<p><input type="file" name="uploading_file" id="uploading_file"></p>
<input type="button" value="-" onclick="decreasing_quantity()">
<input type="text" name="quantity" maxlength="2" size="2" value="0""/>
<input type="button" value="+" onclick="increasing_quantity()">
<input type="submit" value="Submit Files">
</form>
</body>
</html>
那个<p>标签是在<form>里面的,如何在javascript里面通过DOM获取?
<head>
<title>Upload File</title>
</head>
<body>
<form name="myForm" action="#" method="post">
<label for="uploading_file"><strong>File Uploading:</strong></label>
<p><input type="file" name="uploading_file" id="uploading_file"></p>
<input type="button" value="-" onclick="decreasing_quantity()">
<input type="text" name="quantity" maxlength="2" size="2" value="0""/>
<input type="button" value="+" onclick="increasing_quantity()">
<input type="submit" value="Submit Files">
</form>
<script>
alert( document.getElementById('uploading_file').parentNode )
</script>
</body>
</html>