
Solved
How to show answer of operation with answer from slider. (should adjust if respondents move slider)

Best answer by JeremyK
mf18 I pulled this code from developer.mozilla.org and modified it slightly. The Id in the first line of the code is the Id of the slider on my survey. Currently, when I move the slider, I get two console logs, one with a datetime stamp for I can see it working and the second with the value of the slider. Hope this helps!
Qualtrics.SurveyEngine.addOnload(function()
{
// Select the node that will be observed for mutations
const targetNode = document.getElementById("QID2~1~track");
// Options for the observer (which mutations to observe)
const observerOptions = { attributes: true, childList: true, subtree: true };
// Create a new instance of `MutationObserver` named `observer`,
// passing it a callback function
function callback() {
console.log("Inside callback at " + Date.now());
console.log("slider value: " + targetNode.valueOf().textContent);
}
const observer = new MutationObserver(callback)
// Start observing the target node for configured mutations
var x = observer.observe(targetNode, observerOptions);
});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
