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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:19:55+00:00 2026-06-06T16:19:55+00:00

I have assigned a custom data attribute to some circles added to the Raphael

  • 0

I have assigned a custom data attribute to some circles added to the Raphael canvas as follows in a each() loop:

marker.data('transaction', transaction);

How do I find elements on the canvas that have the same transaction data value, and get their location into an array in a for loop, and then perform actions on that array?

For example in pseudo code:

for (current_transaction = 1; current_transaction < 10; current_transaction++) {
    var array = find the location of elements with transaction data value of 
    current transaction;
    //perform some function with that array
}

My question is really then, how do you ‘getElementByData’, and then search for elements with the same data. The rest is simple.

  • 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-06T16:19:57+00:00Added an answer on June 6, 2026 at 4:19 pm

    document.querySelectorAll(‘[transaction]’) would get everything with the attribute transaction.

    Use [transaction=’foo’] to get just transaction attributes having the value foo e.g.

    <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
    
      <path transaction="1"/>
      <path transaction="2"/>
      <path transaction="1"/>
    
      <script>
        for (var current_transaction = 1; current_transaction &lt; 2; current_transa
    ction++) {
           var found = document.querySelectorAll("[transaction='" + current_transact
    ion +"']");
           alert(found.length);
        }
      </script>
    
    </svg>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom attribute which can be assigned to a class, [FooAttribute] .
I have a list of div's in my code which have a custom data-attribute
I have added hashtable(ID and Name) as custom property for each item (Node). The
I have defined some custom attributes and assigned them to products via the Opencart
I have a custom data entry form which is bound to a ViewModel (VM).
I have a custom UITableView populated by JSON data brought into a NSMutableDictionary. I
I have a custom modal dialogue that consists of a simple div and some
Alright, I have some data that I need to assign an int type identifier
I have been assigned a new project to do some enhancements, but while compiling
I have a custom post type and a custom taxonomy. Each custom post type

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.