onclick Example

Clicking on things is very common on web sites. This example shows how to bind a function to the click handler of a button.

<div id="app"> <input type="text" onkeyup="annoy"> </div>
import {rjsf} from '../rjsf.js' (function() { const appElement = document.getElementById('app'); const app = new rjsf(appElement); const viewmodel = { functions: { annoy: function(e) { e.preventDefault(); alert('this is annoying isn\'t it?'); } }, }; app.init(viewmodel); })();

Back to example index