The example below dynamically creates 10 div elements and randomly set their coordinates around. One of them is then called by invoking the instance’s function and allocate it to a specific location.
I believe there is a more elegant way to implement this example and if you have a better way than what I’ve done, feel free to educate me. : )
Click here to see the script in action via jsFiddle