generated from Open-Coding-Society/portfolio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting.html
More file actions
26 lines (26 loc) · 725 Bytes
/
testing.html
File metadata and controls
26 lines (26 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!-- name input field -->
<html>
<head>
<title>Testing</title>
<!-- permalink -->
</head>
<body>
<h1>Testing</h1>
<p>Testing</p>
<form onsubmit="return changeName(event)">
<input type="text" id="nameInput" placeholder="Enter new name.">
<input type="submit" value="Save changes">
</form>
<div class="result">
<a href="#" id="headerName">Welcome,<br /> User</a>
</div>
<script>
function changeName(event) {
event.preventDefault();
let name = document.getElementById("nameInput").value;
document.getElementById("headerName").innerText = "Welcome,\n" + name;
return false;
}
</script>
</body>
</html>