prevent typw more than max number

PHOTO EMBED

Tue Mar 01 2022 09:24:52 GMT+0000 (UTC)

Saved by @KhaledOghli #javascript

		checkMaxNumber(event) {
			if(event.target) {
				// document.querySelector('.maxNum').addEventListener('keydown',function (e) {
						if (event.target.value > 100 
						&& event.keyCode !== 46 // keycode for delete
						&& event.keyCode !== 8 // keycode for backspace
						) {
							event.preventDefault();
							event.target.value = 100;
					}
				// })
			}
		},
content_copyCOPY