JS Draw line between two or more points

drawing, javascript

Solution

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.

Problem

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!

Original source

Related problems