Files
frontend-bootcamp/step1-01/js-demo/js-demo-final.html
Micah Godbolt d8702ec24e misc fixes
2019-02-26 11:21:28 -08:00

46 lines
1.2 KiB
HTML

<html>
<head>
<link rel="stylesheet" href="../css-demo/css-demo-final.css" />
</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 id="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 email = document.getElementById('email');
const text = email.value;
for (let letter of text) {
if (letter === match) {
matches++;
}
}
const submit = document.querySelector('.submit');
submit.value = matches + ' matches';
}
</script>
</html>