. I want the text inside the button to say โ€œI likeโ€, but now it...">

Change text from "Submit" on input tag

I have a <input type="submit" class="like"/> . I want the text inside the button to say โ€œI likeโ€, but now it says โ€œSendโ€.

class="like" way, class="like" are CSS buttons.

+74
html
Dec 22 '12 at 23:59
source share
3 answers

The value attribute in submit -type <input> elements controls the displayed text.

 <input type="submit" class="like" value="Like" /> 
+114
Dec 23 '12 at 0:00
source share

The value attribute is used to determine the display label of the input representation.

 <input type="submit" class="like" value="Like" /> 

Note that if the control is successful (this one will not be the same as it does not have name ), it will also be the passed value for it.

To have a different represented value and label, you need to use a button element in which the textNode inside the element defines the label. You can include other elements (including <img> here).

 <button type="submit" class="like" name="foo" value="bar">Like</button> 

Please note that <button> support is inconvenient in older versions of Internet Explorer.

+24
Dec 23 '12 at 0:00
source share
 <input name="submitBnt" type="submit" value="like"/> 

the name is useful when using $_POST in php, as well as in javascript as document.getElementByName('submitBnt') . You can also use the name as a CS selector, for example, input[name="submitBnt"] ; Hope this helps

0
Dec 23 2018-12-12T00:
source share



All Articles