I have the following code,
var loginForm = document.createElement('div');
loginForm.className = 'row';
loginForm.innerHTML = '<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label textfield-demo"><input class="mdl-textfield__input" type="text" id="login" /><label class="mdl-textfield__label" for="login">Username</label></div>';
document.getElementById('page-content').appendChild(loginForm);
The problem is that since the javascript functions have already ran the input is not styled correctly.
Does anyone what javascript function I need to call to make this work? I tried MaterialTextfield.prototype.init()
but nothing changed.