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 8609641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:55:43+00:00 2026-06-12T03:55:43+00:00

I am using jQuery’s on() function on iOS’ Safari Mobile Browser like this: $(#content).on(.element,

  • 0

I am using jQuery’s on() function on iOS’ Safari Mobile Browser like this:

$("#content").on(".element", click(function(){ do stuff});

When clicking on .element Safari highlights the whole #content area instead of just the area .element takes.

When using

$(".element").click(function(){do stuff});

instead the right area is highlighted. I guess this is the expected behavior but it’s not intuitive for the user at all, so I’m looking for a workaround.

I know I can get rid of the highlighting completely by using -webkit-tap-highlight-color: rgba(0,0,0,0); but I think the highlight is actually pretty useful generally since CSS’ hover isn’t useful on mobile devices already.

Is there a way with jQuery’s on function and Safari Mobile to get the tap highlight of the .element?

  • 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-12T03:55:44+00:00Added an answer on June 12, 2026 at 3:55 am

    I solved it the following way:

    1. Put document.addEventListener("touchstart", function(){}, true); in document ready function enabling the css :active pseude class
    2. Disabling the tap highlight completely: -webkit-tap-highlight-color: rgba(0,0,0,0);
    3. Adding .element:active{background: #cccccc;}

    This way the clicked (active) element gets a nice gray background when touched.

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

Sidebar

Related Questions

Using jQuery validation - validating on blur: $('input, select, radio, checkbox').blur(function(){ $(#createAccount).validate().element(this); }); If
Using jQuery Nearest Element , I would like to select elements in a circular
Using jQuery, I make these changes in the DOM: $(document).ready(function() { $('.editable').click(function() { var
(using jquery) I have the following function $(function() { $('tr.parent') .css(cursor,pointer) .attr(title,Click to expand/collapse)
Using jQuery 1.7.2 $(function(){ $('#parentElem').mouseenter(function(){ $('.myElem').animate({opacity:1}, 'fast'); }).mouseleave(function(){ $('.myElem').stop().animate{opacity:0}, 'slow'); }); }); In this
Using jQuery I'm programmatically generating a bunch of div 's like this: <div class=mydivclass
using jQuery I have the following code: var selectedIdsArray = $(#selectId option:selected).map(function(){return this.value;}); var
Using Jquery, how do I find and hide elements like this? <p>MyHeader</p> The only
Using jQuery, how can I get the input element that has the caret's (cursor's)
Using jQuery, one can easily find out whether a particular element is visible using

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.