Menu
×
×
Correct!
Exercise:Provide the correct code so that the default browser refresh on submit is prevented. Also, provide code so that the input field values get a two-way binding to the Vue data instance properties 'itemName' and 'itemNumber'.
<form v-on:@(14)="addItem">
<p>Add item</p>
<p>
Item name:
<input type="text" required @(7)="itemName">
</p>
<p>
How many:
<input type="number" @(7)="itemNumber">
</p>
<button type="submit">Add item</button>
</form>
<form v-on:submit.prevent="addItem">
<p>Add item</p>
<p>
Item name:
<input type="text" required v-model="itemName">
</p>
<p>
How many:
<input type="number" v-model="itemNumber">
</p>
<button type="submit">Add item</button>
</form>
Not CorrectClick here to try again. Correct!Next ❯ |
This will reset the score of ALL 54 exercises.
Are you sure you want to continue?