Class Add

When button is clicked, it will set fixed specified html to the target

<button type="button"
    data-as='{
        "click": {
            "class.add": {
                "target": "#b",
                "class": "selected"
            }
        }
    }'
>Add Class 'selected' to #b</button>

<ul>
    <li id="a">A</li>
    <li id="b">B</li>
    <li id="c">C</li>
</ul>
  • First
  • Second
  • Third