DEV Community

Discussion on: Amazing Clear Input Using HTML & JS

Collapse
 
kylesureline profile image
Kyle Scheuerlein

Well, as with everything... it has trade offs.

With your approach you get full control over the design of the โ€œxโ€, but it requires JS and you need to use care to make sure it remains accessible.

With <input type=โ€œsearchโ€ /> you canโ€™t change the look of the โ€œxโ€, but it will match their OS, which could be desirable! It also wonโ€™t require JS to function and should be accessible.

Thread Thread
 
nikhil27b profile image
Nikhil Bobade

I updated my code ๐Ÿ˜ƒ