Like my initial post, you kind of missed what they're after. Unlike my initial post, what you've done is "JavaScript for nothing" since pattern="" can do the same thing. Also, what makes a label + input a grammatical <p>aragraph? Why are you using the onevent trash like it's still 1998? Why state empty values? And you REALLY need to read the whole thread, see how "onkeydown" doesn't work on some mobile device inputs. For space or other delimit methods you should be checking "oninput" instead... mind you, that's not entirely on you. "oninput" is a semi-recent (if 2005 to 2006 can be called "recent") addition to JavaScript that hasn't gotten enough word of mouth. Really for full "proper" behavior, one should be trapping onkeydown for "Enter" with an event.preventDefault(), oninput for " " (space), AND onblur. Things crapping the JavaScript events into the markup is going to hobble the implementation of.
@deathshadow I agree "oninput" will be a better choice than "onkeydown". And I also agree, if it can be done without js, then that is the best choice!