Use class selector to execute a script on complete rendering.

15 views
Skip to first unread message

Swap

unread,
Nov 21, 2016, 6:17:04 AM11/21/16
to Ractive.js
Hi, I'm trying to use Ractive to execute a script for all div's with a specific class while the div has just completed rendering. I'm using the below code:

<body> <div class='container'>Hello</div> <div class='container'>World</div> <script> var ractive = new Ractive({ el: '.container', onrender: function () { console.log("22"); } }); </script> </body>

For the above code, I can see only one entry in the console. How do I get ractive to execute the onrender script for all elements having container as class?

Any pointer will be helpful! Thanks!!
Reply all
Reply to author
Forward
0 new messages