Created
February 25, 2015 20:10
-
-
Save gunnarbittersmann/aa40097e34d8d9dafffb to your computer and use it in GitHub Desktop.
number input text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * number input text | |
| */ | |
| :invalid { background: #FCC } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form action=""> | |
| <input type="number" name="number" step="0.0001"/> | |
| <button>submit</button> | |
| <output></output> | |
| </form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var formElement = document.querySelector('form'), | |
| inputElement = document.querySelector('input'), | |
| outputEleent = document.querySelector('output'); | |
| formElement.addEventListener('submit', submitFunction, false); | |
| function submitFunction(event) | |
| { | |
| event.preventDefault(); | |
| outputElement.innerHTML = inputElement.value; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment