DEV Community

loading...

Discussion on: Amazing Clear Input Using HTML & JS

Collapse
nikhil27b profile image
Nikhil Bobade Author

Yes I know about that but I forgot to use πŸ˜… and i use some of code from my previous post

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 Author

I updated my code πŸ˜ƒ