<community>of XML and SVG Developers</community>
This is a discussion on onclick within the SVG Questions forums, part of the SVG Forums category; cant get onclick button to work, want to click on "eyeLast" triangle, and change colour of "eye1" circle. its something ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| want to click on "eyeLast" triangle, and change colour of "eye1" circle. its something easy no doubt but don't have debugger to help. Anyone know this? <script language="JavaScript"> function changeColour() { eye1.style="fill:red" } </script> <path id="eyeLast" onclick="changeColour()" d="M 80 70 L 60 85 80 100 z" style="stroke:black; stroke-width:3; fill:blue" /> <circle id="eye1" cx="520" cy="300" r="20" style="fill:blue" /> |
| |||
|
Try this <script language="JavaScript"> function changeColour(evt) { eye1 = evt.target.ownerDocument.getElementById("eye1") eye1.style.setProperty("fill","red") } </script> <path id="eyeLast" onclick="changeColour(evt)" d="M 80 70 L 60 85 80 100 z" style="stroke:black; stroke-width:3; fill:blue" /> <circle id="eye1" cx="520" cy="300" r="20" style="fill:blue" /> See http://www.learnsvg.com/tutorial2/ex...etProperty.svg Michel |
![]() |
| Tags |
| onclick |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Printer Ink Cartridge
Buy your printer ink cartridge from this online company and save.
ink jets
When it comes to ink jets, speak to ink specialists, speak to us. Call us freephone and benefit from our great prices for ink. Quality!
Hard Disk Drive Data Recovery North West
Professional data recovery! Professional service! Visit the above link.