Validate Slug Pattern

HTML
<p><input type="text" pattern="[a-z\\d]+(?:-[a-z\\d]+)*" required></p>
CSS
body {padding:1em} input {border:1px solid green} input:invalid {border-color:red}
JAVASCRIPT
Expand for more options Login