avivar avivar - 7 months ago 16
Javascript Question

Is it possible to highlight part text of input button value?

I'm trying to bold part of the text inside an input button value.
HTML doesn't work inside the value attribute, so tags like

<b>
and
<strong>
and also methods like
bold()
won't work.

Is it possible to bold just part of the text?

Answer

Using an input of type button and adding HTML to the value won't work, but you can just use a button element instead

<button><strong>Hello</strong> Kitty</button>

FIDDLE