Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit48afc0d

Browse files
authored
Get input value as a number
1 parent5b5e313 commit48afc0d

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)

[8]ページ先頭

©2009-2025 Movatter.jp