Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7278611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:53:52+00:00 2026-05-28T22:53:52+00:00

Our specification requires a cancel button in the search box and I know how

  • 0

Our specification requires a cancel button in the search box and I know how to make one, but I was hoping to utilize the built-in webkit search cancel button “the x” and then fallback to the manual solution if such support doesn’t exist. How would I even check if the feature exists? I don’t see any way of doing it with Modernizr.

<input type="search" name="q" placeholder="Search all..." results="5">

Here’s a useful link for removing styles, but I only want to add styles if support doesn’t exist, so this doesn’t help me:

http://css-tricks.com/webkit-html5-search-inputs/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T22:53:53+00:00Added an answer on May 28, 2026 at 10:53 pm

    If you want to use the Modernizr, you can add the following custom test:

    Modernizr.testStyles(
        '#modernizr, x::-webkit-search-cancel-button { width: 9px; }',
        function(elem, rule){
            Modernizr.addTest('search-reset', elem.offsetWidth == 9);
        });
    

    See it in action here: http://dabblet.com/result/gist/1725982

    Doing so you can test if the browser supports the -webkit-search-cancel-button pseudo-element, so you can rely on it. However, you still could want to follow the other browsers’ progress, so you could add the corresponding selector to the Modernizr’s test.

    Sad that you can’t do this feature-proof since this element is not standardized and is webkit-only.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a really conviluted piece of SQL, I know, but basically one of
Our team is creating a new recruitment workflow system to replace an old one.
Our dev shop currently uses Visual SourceSafe. We all know how that could end
One of our current milestones on our (open source) project at the moment is
The web client of our application makes use of xforms. A message box pops
In our SVN-Code Repository, I came across a package specification that -after removing a
We're developing an socketserver who should receive xml. our specification said, a xml stream
We are about to write a full set of tests for one of our
Our new project requires us to incorporate an Atypon adapter (ISAPI Filter) to be
We have an automated method which takes our in-house report specification files and creates

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.