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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:21:36+00:00 2026-06-14T18:21:36+00:00

I am developing a mobile page with jquery mobile and HTML5. I want to

  • 0

I am developing a mobile page with jquery mobile and HTML5.

I want to change the div color(initially color is in black), when i am pressing(tapping or clicking) that div, i want to change that div’s color to white from black and after i removed my tapping i.e. after i took out my finger from that div i want to restore to black as before.

Is any event there for this kind?.Please help me in this.Thanks in advance.

<!--START:Initial state of  Div Where i want to change color to white when i press that div and change back to normal after i remove my finger-->
<div class="colorBlack inactive"><div>
<!--END:Initial state of Div Where i want to change color to white when i press that div and change back to normal after i remove my hand-->

<!--START: Div class is changed to colorWhite,when i am tapping that div or i am holding that div with my finger-->
<div class="colorWhite active"><div>
<!--END: Div class is changed to colorWhite,when i am tapping that div or i am holding that div with my finger-->


<!--START: Div class is changed back to colorBlack,when i remove my finger -->
<div class="colorBlack active"><div>
<!--START: Div class is changed back to colorBlack,when i remove my finger -->
  • 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-14T18:21:37+00:00Added an answer on June 14, 2026 at 6:21 pm

    You can use touch start and touch end events for this.

    $('#test').bind('touchstart', function() {
        $(this).css('background-color', 'black');
    });
    
    $('#test').bind('touchend', function() {
        $(this).css('background-color', 'white');
    });​
    

    Here is working DEMO

    You can find more information about native DOM events on MDN webstite.

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

Sidebar

Related Questions

I am developing an app using jquery mobile.. In that i want to show
I am developing an events page using jquery mobile. I have a stylish way
I want to look into developing mobile applications using HTML5. I'm very new to
I am new to phonegap.I am using jquery mobile with html5 for developing android
I am developing an application using PhoneGap and jQuery Mobile. Now when the page
i am developing a mobile HTML5 page with css3, i am having the page
I have a mobile webapp that I am developing using jquery mobile. I am
I am developing a mobile app using HTML5, Javascript, jQuery Mobile, and offline storage.
I'm developing a mobile site and using jQuery. When I load a certain page
I am developing mobile web page. I want send from this page request to

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.