I have a submit button that is used to save a form. Inside the submit button I want to use a HTML tag. I am using Font Awesome and I would like the save icon to appear next to the word save in the button. The HTML for this is
<i class="icon-save"></i> Save
The only problem is I cannot seem to get HTML to render inside the value=""
property on the submit button. How can I get HTML to render inside the submit button? This doesn't parse the HTML, it actually renders a button with the literal contents
<input type="submit" value="<i class='icon-save'></i> Save" />
Here is an example of what I want
Definition and Usage The <input type="submit"> defines a submit button which submits all form values to a form-handler. The form-handler is typically a server page with a script for processing the input data. The form-handler is specified in the form's action attribute.
To use the anchor tag as submit button, we need the help of JavaScript. To submit the form, we use JavaScript . submit() function. The function submits the form.
To Link HTML Input type submit to another page using HTML Form tags, we have to declare/write our HTML input type submit button between HTML Form Tag's Starting and Closing Tags. In HTML Form tag's Action attribute, we have to give our Another Web page's link (Where we want to Link out Input type submit Button).
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.
did you try the button
tag like this :
<button type="submit">
<i class='icon-save'></i> Save
</button>
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