You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/documentation/tutorial/06-bindings/02-numeric-inputs/app-b/App.svelte

27 lines
407 B

<script>
let a = 1;
let b = 2;
</script>
<label>
<input type="number" bind:value a} min="0" max="10" />
<input type="range" bind:value a} min="0" max="10" />
</label>
<label>
<input type="number" bind:value b} min="0" max="10" />
<input type="range" bind:value b} min="0" max="10" />
</label>
<p>{a} + {b} = {a + b}</p>
<style>
label {
display: flex;
}
input,
p {
margin: 6px;
}
</style>