Dynamic.js demo

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 toggle the message's display via a data attribute

I am toggled on!

I toggle the message's display via a data attribute and a selector function

I am toggled on!

I toggle the messages' displays via a data attribute with expression

[First] I am toggled on!

[Second] I am toggled on!

I toggle the message's display via a JSON config

I am toggled on!