Abdul Basit Khan

Joined

750 Experience
0 Lessons Completed
1 Question Solved

Activity

i'm done

for example in jquery we do this =>

So instead of...
$(".myclass").click( function() {
// do something
});

We do this....
$('body').on('click', 'a.myclass', function() {
// do something
});


example for Javascript =>
document.body.addEventListener( 'click', function ( event ) {
if( event.target.id == 'btnSubmit' ) {
someFunc();
};

} );

my question is that how i achieve this is in stimulus js ?
because i'm working with ruby on rails when i render a form from back-end it's data-action and other things not working but out of the form everying is working fine.