CreativeIT / getmdl-select

Select for material-design-lite
http://creativeit.github.io/getmdl-select/
MIT License
301 stars 87 forks source link

It does not work when the element is called via JavaScript #49

Closed darwindlrd closed 7 years ago

darwindlrd commented 7 years ago

captura de pantalla 100 When you click on a button to load the form through JavaSccript stops working.

What does it mean? Well, changing "country" does not accept it, ie it is fixed in Germany

HTML:

<div class="mdl-card__actions mdl-card--border"> <a onclick="myFunction()" class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect">Get Started</a> </div>

`

            </section>`

The content loads in the "business"

And JavaScript

function myFunction() { registrationSection.classList.add('hide'); var business = document.getElementById('business'); business.innerHTML =

        <label for="sample1" class="mdl-textfield__label">Country</label>
        <ul for="sample1" class="mdl-menu mdl-menu--bottom-left mdl-js-menu">
            <li class="mdl-menu__item">Germany</li>
            <li class="mdl-menu__item">Belarus</li>
            <li class="mdl-menu__item">Russia</li>
        </ul>
    </div>
componentHandler.upgradeElements(business);

};`

JeckPikachan commented 7 years ago

@darwindlrd have you called "getmdlSelect.init(cssSelector)" function?