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

  • SEARCH
  • Home
  • 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 9023597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:47:57+00:00 2026-06-16T05:47:57+00:00

After this post i found a strange bug in jQuery or in Firefox. Can

  • 0

After this post i found a strange bug in jQuery or in Firefox. Can you explain which of it is right.

jQuery(document).ready(function(){

    //Works on Windows in: Firefox(17.0.1), IE
    //Doesn't work on OS X 10.8 in: Firefox(17.0.1), Safari
    //And also doesn't work on Windows in Chrome
    jQuery('input').focus(function(){
        jQuery(this).val('');
    });

    //Same on events: change, click, select, on
    jQuery('.checkbox').click(function(){ 
        alert(jQuery(this).val());
    });
});​

Here is example http://jsfiddle.net/nonamez/Gq8VK/

  • 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-06-16T05:47:58+00:00Added an answer on June 16, 2026 at 5:47 am

    Not all browsers have the same behavior when it comes to form elements. What you are seeing is that webkit browsers aren’t causing the checkbox to be focused as a result of the click event. Whether or not this is a bug would be decided by the w3 spec.

    I can’t find a definitive answer at w3.org on the subject. Most of what I’ve found seems to suggest that this is left up to the user agent.

    You can, however, make all browsers behave the same by including this in your scripts: http://jsfiddle.net/Gq8VK/5/

    // Any input that does not receive focus from a mouseclick 
    // will now do so, in all browsers. This shouldn't affect browsers that
    // focus input elements on click. 
    $(document).on('mouseup', 'input', function(){
        if (!$(this).is(":focus")) $(this).focus();
    });
    

    The script is using event delegation, so it will work for all inputs including ones that don’t exist in the DOM when the event is attached.

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

Sidebar

Related Questions

I set a height with jquery. After this height is set, another function shall
EDIT: I just found my problem after writing this long post explaining every little
Ladies and gents, I found a very strange behavior which I cannot explain: Assume
After reading this post and this doc , I'm trying to write a function
After a some time, searching here for some solutions we found this post: How
After reading this post I kinda felt in the same position as the guy
After reading this post on Stackoverflow Google plus popup box when hovering over thumbnail?
EDIT: This post was originally specific to ASP.NET, but after thinking about it I'm
After reading the Bash man pages and with respect to this post , I
I have a csv importroutine which imports my CSV values into Sitecore. After this

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.