I'd like to add a Facebook login button to my HTML page using Javascript:
var button = document.createElement("fb:login-button");
button.size = "xlarge";
parent.appendChild(button);
The button appears, and non Facebook-specific attributes like id
and lang
can be added succesfully. However, adding the size attribute has no effect.
Also, if I try to add any attribute using button.createAttribute()
, I get
Uncaught TypeError: Object #
<HTMLUnknownElement>
has no method 'createAttribute'
Why is Facebook's login button not recognized as a valid HTML element, even though it appears on the page? What is the correct way to insert a Facebook login button using Javascript and change its size?