Data-target attribute - Live demo


List 1

  • List 1 item

List 2

  • List 2 item

<h2>List 1</h2>
<ul data-array="List1">
    <li>List 1 item</li>
</ul>

<h2>List 2</h2>
<ul data-array="List2">
    <li>List 2 item</li>
</ul>

<hr />
<button data-action="add" data-target="List1">Add item to list 1</button>
<button data-action="add" data-target="List2">Add item to list 2</button>
No JS code used for this example

Output templates

Templates used for document and web page generation:

Friendly Name File Name Template