Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <style> input:required { background-color: yellow; } </style> </head> <body> <h3>A demonstration of the :required selector.</h3> <p>An optional input element:<br><input></p> <p>A required input element:<br><input required></p> <p>The :required selector selects form elements with a "required" attribute.</p> <p>The :required selector is not supported in Internet Explorer 9 or earlier versions.</p> </body> <!-- Mirrored from www.w3schools.com/cssref/tryit.asp?filename=trycss_sel_required by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:14:07 GMT --> </html>
Result:
Try it Yourself - © w3schools.com