Is there any Dataset Ticker Optional Javascript Sample for working with snippets values?

Related to this topic Here's how to show as many ticker items as will fit solution is;

if you use dataset ticker, do not use tags and start the script as;

$(document).ready(function() {
  var datavalue= -1;
  var element = document.getElementById("arrow");
  
  if (datavalue > 0) {
  element.className = element.className.replace(/\bright-arrow\b/g, "up-arrow");
}
	else if (datavalue < 0) {
    element.className = element.className.replace(/\bright-arrow\b/g, "down-arrow");
   }
   else {
   element.className = element.className.replace(/\bright-arrow\b/g, "right-arrow");
   }
return;
});

Works perfect now with test datavalue,

I will be glad if someone show me the way of using remote dataset value as a source for this function ? is there a way to use snippets directly?