'<button id="'+item['id']+'" class="btnDeactivateKeyInChildPremiumCustomer waves-effect waves-light>ok</button>'
I used the above code to generate a button inside the jquery of each function. The button was created dynamically, and when I pressed the button, it should show the progress on the button. I am using this Ladda Button Loader .
btnDeactivateKeyInChildPremiumCustomerClick : function(event){ var id = event.currentTarget.id; var btnProgress = Ladda.create(document.querySelector('#'+id));
And then I passed the button to the event handler to capture the event process above. Inside this function, it will create a btnProgress object. After that, I can call the start () or stop () functions. I successfully worked in the case of only one button without dynamically creating a button inside each. But in each case, it shows some errors when executing var btnProgress = Ladda.create (document.querySelector ('#' + id))
Mistake
Uncaught SyntaxError: Failed to execute 'querySelector' on 'Document': '#22' is not a valid selector.
boycod3
source share