0

Okay Just being geek! I have found something strange. In HTML5 when we write this tag:

<input type="number" min="2" max="5"/> Number Only

So technically, it won't allow to use letters. But Strange part is it allows letter "e" to be typed in rather than any other letters. Why this happens?

Jaymin
  • 1,643
  • 1
  • 18
  • 39

2 Answers2

2

Because of exponent notation: 1.25E+3

Amit
  • 45,440
  • 9
  • 78
  • 110
1

e is allowed as part of Scientific Notation, so that when you need to write a large number, you can do it concisely.

Try inputting 2.4e5 and then hitting the up or down arrows.

<label>
  Enter a number:
  <input type="number" min="1" max="1000000000"/>
</label>
zzzzBov
  • 174,988
  • 54
  • 320
  • 367
  • Why are you posting an answer that repeats mine? If you want to add an example you can edit the existing answer... – Amit Aug 19 '16 at 05:18
  • @Amit, I posted an answer because I felt that I could provide additional detail that yours was lacking. Competition is good as it encourages quality. – zzzzBov Aug 19 '16 at 05:19
  • Collaboration encourages quality. Competition encourages rivalry and fragmented answers. – Amit Aug 19 '16 at 05:21
  • @misterManSam, "you should all delete your answers" no, that's not how duplication works. Leaving the answers is fine, just be sure to vote to close the exact duplicate. – zzzzBov Aug 19 '16 at 05:27
  • @zzzzBov - you're probably right, and I usually look for dupes when the answer is "long enough". In this case it was simply quicker to answer. – Amit Aug 19 '16 at 05:35