<script src="https://unpkg.com/vue/dist/vue.js"></script>
<div id="app">
<!-- EXERCISE 1: Make the below text input update a data property on every
"keyup" event. Also output the data property.
Hint: event.target.value gives access to input value. -->
<input type="text">
Output:
<br><br>
<!-- EXERCISE 2: Make the below text input update the data property from
exercise 1, but only when pressing the Control + Enter keys.
Hint: The key modifier for the Control key is named "ctrl" -->
<input type="text">
Output:
<br><br>
<!-- EXERCISE 3: Prevent the below form from submitting.
Hint: Prevent the "submit" event on the form. -->
<form action="" method="GET">
<input type="submit" value="Submit">
</form>
</div>
JavaScript
new Vue({
el: '#app'
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.