mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
42 lines
1.1 KiB
HTML
42 lines
1.1 KiB
HTML
<html>
|
|
<head> </head>
|
|
<body>
|
|
<div>
|
|
<h1>This is my <span>Title</span></h1>
|
|
<div class="tiles">
|
|
<div class="links">
|
|
<h2>Important Links</h2>
|
|
<a href="#">We're Awesome</a>
|
|
<a href="#">Learn More</a>
|
|
<a href="#">Hire Us</a>
|
|
</div>
|
|
<div>
|
|
<h2>Our Logo</h2>
|
|
<img src="../assets/fabric.jpg" width="100" alt="fabric logo" />
|
|
</div>
|
|
<div>
|
|
<h2>Contact Us</h2>
|
|
<div id="contact-form">
|
|
<label>Email</label><input class="email" type="email" />
|
|
<input onclick="displayMatches()" class="submit" value="Submit" type="submit" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
const match = 'a';
|
|
let matches = 0;
|
|
|
|
function displayMatches() {
|
|
const text = document.querySelector('.email').value;
|
|
for (let letter of text) {
|
|
if (letter === match) {
|
|
matches++;
|
|
}
|
|
}
|
|
document.querySelector('.submit').value = matches + ' matches';
|
|
}
|
|
</script>
|
|
</html>
|