material design lite - How to focus an MDL TextField -


what proper way focus material design lite textfield?

this works:

$("#mytextfield").focus(); 

this not work:

document.getelementbyid('mytextfield').parentnode.materialtextfield.focus(); 

however, similar code works disable textfield:

document.getelementbyid('mytextfield').parentnode.materialtextfield.disable(); 

you don't need jquery.

  input.focus();   input.parentnode.classlist.add('is-dirty'); 

Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

javascript - Why Selenium can't find an element that is graphically visible -

qt - Microsoft FTP Service 451 The parameter is incorrect -