diff --git a/public/index.html b/public/index.html index 9092821..0f3e8c2 100644 --- a/public/index.html +++ b/public/index.html @@ -63,6 +63,8 @@ + + \ No newline at end of file diff --git a/public/script.js b/public/script.js new file mode 100644 index 0000000..3db4d42 --- /dev/null +++ b/public/script.js @@ -0,0 +1,26 @@ +function Hello(props) { + return H('div', `Hello ${props.toWhat}`); +} + +function FinalImage(props) { + return H('img', { src: props.src }); +} + +function Dropdown(props) { + return H('select', { className: 'dropdown' }, + props.options.map(o => H('option', o)) + ); +} + +function Clickable(props, state, setState) { + const { clicks = 0 } = state; + + return H('button', + { + onclick() { + setState({ clicks: clicks + 1 }) + } + }, + `Clicked ${clicks} times` + ); +} \ No newline at end of file