2
0
mirror of https://github.com/esiur/iui.git synced 2025-06-27 09:23:12 +00:00
Files
iui/docs/md/getting-started/scripts.md
2021-11-15 00:11:12 +03:00

914 B

#Scripts

Scripts within tags are executed as functions with the scope varaiables and this argument is set to the parent element

<script> this.onclick = () => { alert("Hello World !")}; this.innerHTML = "Click me"; </script>

When the function returns an object it will be projected to the parent element.

<script> this.onclick = () => { alert("Hello World !")}; return {innerHTML: "Click Me"} </script>

Scope variables example

<script> this.onclick = () => { refs.msg.innerHTML = new Date().toTimeString(); }; return {innerHTML: "Click Me"} </script>