I need change the font weight for a text element in JavaScript:
My code here does not work:
var btn = document.getElementById('accessibilityButton');
btn.innerHTML = 'Default Text';
btn.innerHTML.style.fontWeight = 'bold';
What am I doing wrong?
Please note that I don’t want to use any libraries (jQuery et. al.) and am looking for a plain JS solution.
You need to use:
as it’s a property of the element itself.
See: http://jsfiddle.net/6ypS8/