Content-Length: 298832 | pFad | http://github.com/roeib/JavaScript-snippets/commit/48afc0ddd55ad4258b441977bea3d34cefe43173

A5 Get input value as a number · roeib/JavaScript-snippets@48afc0d · GitHub
Skip to content

Commit 48afc0d

Browse files
authored
Get input value as a number
1 parent 5b5e313 commit 48afc0d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
|32 | [The void operator](#The-void-operator)|
3939
|33 | [replaceAll](#replaceAll)|
4040
|34 | [Required Function Params](#Required-Function-Params)|
41+
|35 | [Get input value as a number](#Get-input-value-as-a-number)|
42+
4143

4244

4345
**[⬆ Back to Top](#table-of-contents)**
@@ -737,4 +739,18 @@ console.log(getPage());
737739
738740
739741
742+
**[⬆ Back to Top](#table-of-contents)**
743+
### Get input value as a number
744+
745+
```javascript
746+
747+
<input type="number" id="JSsnippets" onkeyup="checkMyType(event)" />
748+
749+
function checkMyType(event){
750+
751+
console.log(typeof event.target.value) // string
752+
console.log(typeof event.target.valueAsNumber ) // number
753+
754+
}
740755
756+
```

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/roeib/JavaScript-snippets/commit/48afc0ddd55ad4258b441977bea3d34cefe43173

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy