5

i need to draw a line between two tags or tags.

Example:
http://caitriona.github.io/connect-the-dots/

I need to do something like this but not like in this script, in an order but randomly.
You can click on "P1" and then on "P2" and the line will be drawn. But if you click on "P1" and then on "P3" an error message should appear (that's not the problem).

My problem is, that I'm not so much a javascript crack to draw the line between the points.

Can someone point me to the right direction?
Thank you!

Marek123
  • 1,193
  • 7
  • 35
  • 75
  • Possible duplicate of [Drawing a line between two draggable divs](https://stackoverflow.com/questions/6278152/drawing-a-line-between-two-draggable-divs) – balupton Nov 05 '18 at 20:43

1 Answers1

13

Take a look at drawing in browser SVG (Scalable Vector Graphics). http://www.w3schools.com/graphics/svg_line.asp

You can do some pretty interesting stuff with it. Go through the W3Schools tutorial. Let me know how it goes.

Wen
  • 103
  • 1
  • 6
shadowcursor
  • 1,174
  • 1
  • 13
  • 19