I think that the normal behavior of a button like the one below is that the value
attribute serves as a label as well:
<input type="submit" name="submitButton" value="DeleteAnswer22" />
Is it possible to have separate attributes for display label and value?
The difference is that <button> can have content, whereas <input> cannot (it is a null element). While the button-text of an <input> can be specified, you cannot add markup to the text or insert a picture.
In HTML, <input type="button" /> is used to create buttons in an HTML form. Inside the <button> tag, you can place content like text or images. But, this is not the case with the buttons created with <input> tag.
The value attribute specifies the initial value for a <button> in an HTML form. Note: In a form, the button and its value is only submitted if the button itself was used to submit the form.
The name attribute of the <button> element is used to set the name for a button. More than one button can have the same name, but we can submit different values from these buttons using the name attribute.
Use the HTML Button element, with type submit
, instead:
<button type="submit" name="submitButton" value="DeleteAnswer22">Delete Answer 22</button>
This will result in a submit button that sends the value DeleteAnswer22
but displays "Delete Answer 22".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With