I made a fiddle here. Not a big issue, since the bottom solution works, but wanted to give you a hint ;)
Open the console or inspect the DOM to see that the first input render only the min attribute, while the second input correctly renders min and max.