s标记获取不到提交的表单
时间: 2024-09-20 21:02:13 浏览: 28
`<s>` 标签并不是 HTML5 中的标准标签,它通常用于表示已删除的内容,而不是用于获取表单数据。如果你想要获取用户提交的表单数据,应该使用 `form` 元素及其相关的属性和方法。
在HTML中,对于表单提交,你需要使用 `<form>` 标签配合 `method` 和 `action` 属性。当用户填写并提交表单时,表单数据会通过 POST 或 GET 请求发送到指定的 URL。例如:
```html
<form id="myForm" action="/submit-data" method="POST">
<!-- 表单输入字段 -->
<input type="text" name="username" />
<input type="email" name="email" />
<!-- 更多输入... -->
<button type="submit">提交</button>
</form>
```
然后,在 JavaScript(如果需要前端处理)或后端服务器(如PHP、Node.js等)上,你可以通过表单的 `onsubmit` 事件或直接访问请求的数据来获取表单内容。
阅读全文
相关推荐


















