I am working with material design lite in my project and I need to attach a function to the click event of the drawer button. I thought it was trivial, so I added this code:
$(document).ready(function(){
$('.mdl-layout__drawer-button).on('click', function(){
console.log('click');
});
but then I discovered that the drawer button is added by mdl.js as the very last element after document.ready, so when I run my code, the button is not yet ready.
Any idea on how to get the selector when it is ready?