HTML 提交按钮:不同的值/按钮文本? [英] HTML Submit-button: Different value / button-text?
本文介绍了HTML 提交按钮:不同的值/按钮文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想创建一个带有 value 'add tag'
的 HTML 表单提交按钮,但是,网页是瑞典语,所以我想要具有不同的按钮文本.
I'd like to create an HTML form submit button with the value 'add tag'
, however, the web page is in Swedish, so I'd like to have a different button text.
也就是说,我想要一个像
That is, I want to have a button like
但我想要我的代码
if (request.getParameter(cmd).equals("add tag"))
tags.addTag( /*...*/ );
这可能吗?如果是这样,如何?
推荐答案
可以使用 button
元素.
<button name="name" value="value" type="submit">Sök</button>
来自 W3C 页面上的 按钮
:
使用 BUTTON 元素创建的按钮功能与使用 INPUT 元素创建的按钮一样,但它们提供了更丰富的呈现可能性:BUTTON 元素可能有内容.
Buttons created with the BUTTON element function just like buttons created with the INPUT element, but they offer richer rendering possibilities: the BUTTON element may have content.
这篇关于HTML 提交按钮:不同的值/按钮文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文