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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:10:01+00:00 2026-06-01T01:10:01+00:00

I have a Raphael text element with both a mouseup and click event handler.

  • 0

I have a Raphael text element with both a mouseup and click event handler. If I alter the text in the mouseup event handler, the click event handler does not get called anymore. Why does this happen?

I tested the following code in Chrome, Firefox and Opera:

<!doctype html>
<html>
<head>
  <script type='text/javascript' src='jquery-1.7.1.js'></script>
  <script type='text/javascript' src='raphael-min.js'></script>
  <script type='text/javascript'>
window.onload = function() {
  var paper = Raphael(document.getElementById('raphael'),500,200);
  var text1 = paper.text(100, 20, "Just movin'");
  var text2 = paper.text(100, 40, "Hello World");

  $(text1.node).mouseup(function() {
    text1.attr({"x" : "200"});
    console.log("text1 mouseup");
  });
  $(text1.node).click(function() { 
    console.log("text1 click"); // Is called
  });

  $(text2.node).mouseup(function() {
    text2.attr({"text": "Goodbye world"});
    console.log("text2 mouseup");
  });
  $(text2.node).click(function() { 
    console.log("text2 click"); // Is not called
  });
}
  </script>
</head>
<body>
<div id="raphael"></div>
</body>
</html>
  • 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-01T01:10:02+00:00Added an answer on June 1, 2026 at 1:10 am

    By doing like this you are removing the dom text2.node and replacing with a new dom which is attached with only click event.

    So try doing like this

     $(text2.node).mouseup(function(event) {
        // event.target is tspan
        // event.target.childNodes[0] is TextNode
        event.target.childNodes[0].nodeValue = "BYE WORLD";
        console.log("text2 mouseup", this);
      });
    

    I tested it it was working fine.

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

Sidebar

Related Questions

If I have append a click event handler function to my Raphael element like
I want to add text to a element in raphael js, I have added
I have javascript function (that uses Raphael) that on click select area. And I
Does anybody have any experience with the Raphael.js SVG library? I'm using Raphael.js to
I have javascript function (that uses Raphael) that on click select area. On double
i have code like this but its not working var t = r.text(100, 100,
I have to clear and redraw a raphael javascript main container. I've tried with
I have been looking at the source code of raphael.js and I see a
Have you managed to get Aptana Studio debugging to work? I tried following this,
I have previously worked with Raphael, but I have returned to my project and

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.