简体   繁体   English

需要帮助将类型属性添加到按钮

[英]Need help adding type attribute to a button

Step 42 Even though you added your button below the text input, they appear next to each other on the page.第 42 步即使您在文本输入下方添加了按钮,它们也会在页面上彼此相邻出现。 That's because both input and button elements are inline elements, which don't appear on new lines.这是因为 input 和 button 元素都是内联元素,它们不会出现在新行上。

The button you added will submit the form by default.您添加的按钮将默认提交表单。 However, relying on default behavior may cause confusion.但是,依赖默认行为可能会导致混淆。 Add the type attribute with the value submit to the button to make it clear that it is a submit button.为按钮添加值为 submit 的 type 属性,以明确它是一个提交按钮。 Code so far到目前为止的代码

I think the person wants you to modify the code like this.我认为该人希望您像这样修改代码。

<button type="button" value="submit">Submit</button>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM