how to limit characters in number input js
function limit(element)
{
var max_chars = 2;
if(element.value.length > max_chars) {
element.value = element.value.substr(0, max_chars);
}
}
<!-- HTML -->
<input type="number" onkeydown="limit(this);" onkeyup="limit(this);">
Also in JavaScript:
- get last date of a month javascript
- jquery wrap inner text
- name class and id referance in ajax
- cordova load javascript without cache
- javascript json trypass
- javascript on url anchor change event
- insert js in html
- Javascript generate random string
- parsley custom error message
- como utilizar jquery
- minecraft
- WHAT IS NODE IN DOM
- Javascript parse json string
- comment dire le nombre de ligne html en cliquamt sur un boutton javascript
- advanced axios in react js using create and interceptor
- javascript loop through array
- delete local storage javascript
- custom event js
- how to use a fixed time zone in nodejs
- react native checkbox
- oauth2 spring boot react google example
- react js build production
- dexie update table element
- angular directive example