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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:02:44+00:00 2026-06-03T03:02:44+00:00

Using jQuery, I am trying to capture and display the value of a div

  • 0

Using jQuery, I am trying to capture and display the value of a div class when it is ‘dropped’.
For example, I want to display ’01:20′ when this particular element is dropped.
div class=’routineTime’>01:20 /div>

Additionaly, I want to sum and display a running total of these dropped elements.

I have an example in jsfiddle, but it’s only displaying the ‘routineTime’ of the first element
that is dropped. I need to sum and display ‘routineTime’ for each element that is dropped.

http://jsfiddle.net/n2learning/QfFQ9/9/

Appreciate any help!

DK

  • 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-03T03:02:45+00:00Added an answer on June 3, 2026 at 3:02 am

    You need to implement a iterator for all the dropped elements inside the drop able section.

        drop: function(event, ui) {
            $('#info').find("h1").remove();
    
            var tmp, routineTime = [0, 0];
            $('.routineTime', $(this)).each (function () {
                tmp = $(this).text().split(':');
    
                if ($.trim(tmp[0]) == '') tmp[0] = 0;
    
                routineTime [0] += parseInt(tmp[0], 10);
                routineTime [1] += parseInt(tmp[1], 10);               
            });
    
            routineTime [0] += parseInt(routineTime [1]/60);
            routineTime [1] = routineTime[1]%60;
    
            $('#calcTime').html(routineTime [0] + ':' + routineTime [1]);
    
        }
    

    DEMO

    The addTime logic has its own complexity… which you need to implement inside the $.each

    Edit: Added addTime logic.. Let me know how it goes.

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

Sidebar

Related Questions

Using jQuery I am trying to set focus for (CSS purposes) to a particular
I am trying to find a way using jquery without cookies to display a
I am trying to get an element using JQuery's selector, but it does not
Hey all, I'm using this colorpicker ( http://www.eyecon.ro/colorpicker ) and am trying to capture
I am using the Jquery Wysiwyg editor and I am trying to capture the
Really new to using jQuery and trying to find an example I need. 1)
I have 2 dropdown lists on my webform and using jquery trying to filter/reset
using jquery ui 1.8 trying autocomplete Everything works apart from that the ui-menu isn't
I'm trying to implement authentication using jquery to make an ajax request to a
I'm trying to make simple script using jquery $post function to pass data 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.