< Svelte

Svelte - Űrlap

Űrlap lekérdezése

src/routes/+page.svelte
<script>
let name = '';
let msg = '';
 
function doit() {
    msg = 'Üdv ' + name;
}
 
</script>
 
<h1>Főoldal</h1>
 
<div class="exForm">
    <div class="form-control">
        <label for="name">Név</label>
        <input type="text" bind:value={name}>
    </div>
    <button on:click={doit}>Üdv</button>
</div>
 
<p>{msg}</p>