Having difficulty aligning text with innerHTML
I am trying to create a link element using JavaScript, but I cannot get the text to align to the center. Here is my code:
a= document.createElement('a');
a.style.cssText= 'font-size: 20px; cursor: pointer; text-align:center;';
a.innerHTML = 'Align ME TO CENTER!';
The default alignment is left and I cannot figure out how to change it. Any suggestions?