Abdul Basit Khan


750 Experience
0 Lessons Completed
1 Question Solved


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' ) {

} );

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.

logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.