<form action="javascript:;">
时间: 2023-12-29 08:04:36 浏览: 140
As an AI language model, I cannot perform any action in the real world. However, if you want to create a form with no action, you can use the following code:
```
<form>
<!-- form fields go here -->
</form>
```
This will create a form with no action specified. When the form is submitted, it will simply reload the current page.
相关问题
检查以下错误代码<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <form id="myform" action="javascript:void(0)" method="post"> <input type="hidden" name="pno" value="1" /> <input type="hidden" name="psize" value="3
这段代码缺少一个闭合的标签。应该在第9行后加上 `</form>` 来关闭表单元素。修改后的代码如下:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form id="myform" action="javascript:void(0)" method="post">
<input type="hidden" name="pno" value="1" />
<input type="hidden" name="psize" value="3" />
</form>
</body>
</html>
```
获取如下文本框组件的值( ): <form name="form1" action="" method=""> <input type="text" name="user"> </form>
获取文本框组件的值可以使用JavaScript来实现。首先,我们可以通过name属性获取到文本框的引用,然后使用value属性获取到文本框中输入的值。对于给定的文本框组件,我们可以使用以下代码获取其值:
```javascript
var userInput = document.forms["form1"].elements["user"].value;
```
阅读全文