get point coords

write the coordinates of a point into a text

HTML

<script src="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.js"></script>
<link rel="stylesheet" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css">
<span id="coords"></span>
<div id="jxgbox" style="width:500px; height:500px;"></div>

JavaScript

var board = JXG.JSXGraph.initBoard('jxgbox', {
    axis: true
});


function abd(e)
{
	console.log(e)  

}

var p = board.create('point', [2,1]);

// get the coordinates and store them in pX and pY
pX = p.X();
pY = p.Y();

// print the coords into a text
//var t = board.create('point', [3, 2]);

// print them into a HTML span
board.addHook(function () {
    document.getElementById('coords').innerHTML = 'A = (' + p.X() + ', ' + p.Y() + ')';
}, 'update');