I'm new to js and my task is this: I've to bind a gauge object like one you can download from this rep: https://github.com/Mikhus/canv-gauge.git
to a dom element in order to get it from c++ software. How can I create my var and set it with id, just to use GetElementFromId dom method?
thank you, Daniele
You can try it with jQuery.
Here is the example:
var elt = document.getElementById('dom-id'); jQuery.data(elt, "gauge", gaugeObject);
Be careful that the first argument of
jQuery.data() is a DOM object,
instead of a jQuery object.
When you want to get the binded object, use
var gaugeObject = jQuery.data(elt, "gauge");
©2020 All rights reserved.