{live} makes part of a page interactive without JavaScript of your own. A click on an element with pad-click inside the region posts the event to the page; the page runs again on the server, and only the region comes back and is swapped in.

PHP
fragments/live_1.php
HTML
fragments/live_1.pad
Result
<?php

$count
= (int) padLiveValue ();

if (
padLiveEvent () == 'add' ) $count++;
if (
padLiveEvent () == 'reset' ) $count = 0;

?>
{live 'counter'}
<p>Clicked {$count} times</p>
<button pad-click="add" pad-value="{$count}">Add one</button>
<button pad-click="reset">Reset</button>
{/live}

Clicked 0 times