Dynamic.js is a small library that allows binding simple behaviours to DOM elements using data- attributes.
For more complex behaviours, a <script> tag syntax is available. View the source of this interactive demo page for an example.
I am toggled on!
I am toggled on!
[First] I am toggled on!
[Second] I am toggled on!
I am toggled on!