Skip to content

Instantly share code, notes, and snippets.

@jenshelderweirdt
Last active December 12, 2018 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jenshelderweirdt/d333e5377e5ea14d0af44b544bb7cd4d to your computer and use it in GitHub Desktop.
Save jenshelderweirdt/d333e5377e5ea14d0af44b544bb7cd4d to your computer and use it in GitHub Desktop.
const template = document.createElement('template');
template.innerHTML = `
<!--Label that will display the input-title 'Email'-->
<label for="email-input">Email</label>
<!--Input field that will be validated when it loses focus-->
<input type="text" id="email-input" name="email-input">
<!--Container for the validation text, hidden by default-->
<div>
<small style="visibility: hidden;" id="validationtext"></small>
</div>
<!--Styling for the validation text (class will be added in component logic)-->
<style>
.invalid {
color: red;
}
.valid {
color: green;
}
</style>
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment