Skip to content

Commit 66e07fb

Browse files
Merge pull request #1 from AtudJerry/myBranch
Added an auto focus JavaScript code in script.js file and an id-name to the email…
2 parents 27bf1c1 + 2d17ff4 commit 66e07fb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ <h3>Sign Up For Newsletters</h3>
355355
<h5>get e-mail updates about out latest shop and <span>special offers</span></h5>
356356
</div>
357357
<div class="form">
358-
<input type="email" placeholder="Your email address">
358+
<input type="email" placeholder="Your email address" id="email-address-input">
359359
<button>Sign Up</button>
360360
</div>
361361
</section>

script.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// focus the cursor on the email-address input
2+
const emailField = document.getElementById("email-address-input");
3+
emailField.focus({
4+
preventScroll: true,
5+
});

0 commit comments

Comments
 (0)