如何仅使用input标签实现提交按钮,而非button标签?
问题解决
你的原始代码:
<label>Please enter your name</label><br> <input type="text" id="user0name"> <br> <button type="button" id="userbutton"></button> <input onclick="window.location.href = 'profile.html';" type="submit" value="submit" />
问题说明:
你尝试移除button标签的value属性(但实际上你的button标签并没有设置value属性),但按钮依然在页面上显示。
解决方法:
<button>是独立的页面控件,不管内部有没有文本内容,浏览器都会默认渲染出按钮样式。要让这个按钮消失,直接删除整个<button type="button" id="userbutton"></button>代码块即可,无需操作什么value属性。
内容的提问来源于stack exchange,提问作者Hypnotize-12
相关产品推荐
相关产品推荐

