<p id="myOutput"> </p>
// Define the id of your board in BOARDID
const board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [-4, 4, 4, -4],
keepaspectratio: true
});
var p = board.create('point', [1, 1], {
size: 5
});
JXG.addEvent(p.rendNode, 'mouseover',
function() {
document.getElementById('myOutput').innerHTML = "Point " + this.name;
},
p);
JXG.addEvent(p.rendNode, 'mouseout',
function() {
document.getElementById('myOutput').innerHTML = ' ';
},
p);
// User can not move "A" anymore.
p.hasPoint = function() {
return false;
};
var p2 = board.create('point', [-1, 1], {
size: 5
});
JXG.addEvent(p2.rendNode, 'mouseover',
function() {
document.getElementById('myOutput').innerHTML = "Point " + this.name;
},
p2);
JXG.addEvent(p2.rendNode, 'mouseout',
function() {
document.getElementById('myOutput').innerHTML = ' ';
},
p2);