Is HTML 5 validation useful?

JavascriptWeb DevelopmentFront End Scripts

Yes, HTML5 validation is useful and useful to validate forms as well. Now you do not need to have JavaScript for client-side validations like empty text box would never be submitted because HTML5 introduced a new attribute called required.

Let us see an example −

<!DOCTYPE HTML>
<html>
   <body>
      <form action = "/cgi-bin/html5.cgi" method = "get">
         Enter email : <input type = "text" name = "newinput" required/>
         <p>Try to submit using Submit button</p>
         <input type = "submit" value = "submit" />
      </form>
   </body>
</html>
raja
Published on 05-Apr-2018 16:54:41
Advertisements