software-development-2022/assignment5-2/index.html

34 lines
1.1 KiB
HTML
Raw Permalink Normal View History

2022-11-17 15:48:17 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vue Basics</title>
<link
href="https://fonts.googleapis.com/css2?family=Jost:wght@400;700&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="styles.css" />
<script src="https://unpkg.com/vue@next" defer></script>
<script src="app.js" defer></script>
</head>
<body>
<header>
<h1>Events</h1>
</header>
<section id="assignment">
<h2>Event Practice</h2>
<!-- 1) Show an alert (any text of your choice) when the button is pressed -->
<button @click="showAlert">Show Alert</button>
<hr />
<!-- 2) Register the user input on "keydown" and output it in the paragraph (hint: event.target.value helps) -->
<input type="text" @keydown="update2" />
<p>{{paragraph2}}</p>
<hr />
<!-- 3) Repeat 2) but only output the entered value if the ENTER key was pressed -->
<input type="text" @keydown.enter="update3" />
<p>{{paragraph3}}</p>
</section>
</body>
</html>