Hi there,
I have used Javascript to remove the rating scale for the last row of my survey question. In ‘preview question’ it looks how I want it, like this:

However, when I preview the survey, it still looks like this:

I have also published a copy of the survey and the rating scales appear there too. The JavaScript I have used is as follows:
Qualtrics.SurveyEngine.addOnload(() => {
const questionContainer = document.getElementById("QID41");
if (questionContainer) {
// Select all radio button inputs within the container
const radioButtons = questionContainer.querySelectorAll("input[type=radio]");
// Convert NodeList to array and get the last 2 radio buttons
[...radioButtons].slice(-2).forEach(radio => {
// Disable and hide the radio button
radio.disabled = true;
radio.style.display = "none";
// Find the associated label using 'for' attribute
const label = questionContainer.querySelector(`label[for="${radio.id}"]`);
if (label) {
label.style.display = "none";
}
});
}
});
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});
Any help would be greatly appreciated! Thanks.