So, I am using jqPlot which has this stupid requirement that it needs an element's id
attribute to plot.
However, my javascript uses jQuery, which operates on elements, and I don't want to rely on a div having an id.
Can I somehow, given a jQuery $(this)
element, generate an id
on the fly for a div and pass that id to my jqPlot function?
Something like this:
(function($){ //jquery plugin style
$.fn.myPlot = function(){
//Somehow get id for "this"
var generatedId = somehowCreateID(this);
jqPlot.plot( generatedId );
}
})(jQuery);
Any tips appreciated!