DEV Community

Discussion on: Checking if an input is empty with CSS

Collapse
 
pipobscure profile image
Pip Obscure™️ • Edited

Try pattern=“\S+“ which means has to contain 1 or more non-white-space characters

Collapse
 
lexlohr profile image
Alex Lohr

Since pattern works like new RegExp('^'+pattern+'$'), this won't work if there are white-space characters in the input value.