Reputation: 429
I have button with some entity on it:
<button type='button' disabled class='buttonred' id="buttonred">✗</button>
How can i change the button text to other entity?
document.getElementById('buttonred').text = '✔';
Above will not work.
Upvotes: 0
Views: 1350
Reputation: 67505
You should use innerHTML
instead of text
, Hope this helps.
document.getElementById('buttonred').innerHTML = '✔';
<button type='button' disabled class='buttonred' id="buttonred">✗</button>
Upvotes: 1
Reputation: 216
In this case to change from X in the button to a 'Tick' try using innerHTML.
document.getElementById('buttonred').innerHTML = '✔';
fiddle for your reference http://jsfiddle.net/825sgc6x/
Upvotes: 0