W3C home > Mailing lists > Public > www-svg@w3.org > June 2001

Re: Retrieving svg element inside a script

From: Philippe Converset <pconverset@Qarbon.com>
Date: Mon, 11 Jun 2001 19:50:36 +0200
Message-Id: <5.1.0.14.0.20010611194754.02d46250@mail.qarbon.com>
To: www-svg@w3.org
OK, I've found the answer:

function circle_click(evt) {
svgdoc=evt.getTarget().getOwnerDocument();
circle=svgdoc.getElementById("circle1");
...
}

Next time, I'll try to search on Internet before asking the mailing list, 
sorry :-(


At 07:40 PM 6/11/2001 +0200, Philippe Converset wrote:
>Hi,
>I need to retrieve an SVG element using a ecmascript event.
>Let's say my SVG code has a circle element with the id "circle1" and 
>another element that responds to an onclick event and runs a ecmascript 
>function. How do I retrieve my circle in this function. I thought the 
>following line could work but it's not.
>var circle = document.all("circle1",0);
>
>Any idea ?
>
>Thanks
Received on Monday, 11 June 2001 13:50:08 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:20 GMT