Bake dates into articles
This commit is contained in:
@ -5,6 +5,8 @@ tags: javascript,browser,input
|
||||
authors: chalarangelo
|
||||
cover: blog_images/mac-and-coffee.jpg
|
||||
excerpt: Ever wanted to get the value of an HTML input element as a number? Learn an easy way to do it with this handy trick.
|
||||
firstSeen: 2020-11-20T09:19:24+02:00
|
||||
lastUpdated: 2021-06-12T19:30:41+03:00
|
||||
---
|
||||
|
||||
Most of the time, when accessing the value of an `HTMLInputElement` in an event listener, we use something along the lines of `e.target.value`. This is fine in most cases, but when we want the numeric value of an input field, we have to parse it and check if the value is actually valid etc. That can get very annoying, especially when working with larger forms that have many input fields.
|
||||
|
||||
Reference in New Issue
Block a user