79408817

Date: 2025-02-03 12:38:48
Score: 1
Natty:
Report link

thanks to @C3row I got to the solution of this.

Qualtrics.SurveyEngine.addOnReady(function()
{
    /*Place your JavaScript here to run when the page is fully displayed*/

var base_element = document.querySelector(".QuestionOuter");
base_element.insertAdjacentHTML('afterbegin', '<div id="sticky_vid" style="position: sticky; top:0;" align="middle">');

var new_element = document.querySelector("#sticky_vid");

// Change the text below to add the element of your choice
new_element.innerHTML = `<div class="QuestionText BorderColor"><p align="left">
<br>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br>
&nbsp;
<table border="1" cellpadding="1" cellspacing="1" style="width:1000px;">
    <thead>
        <tr>
            <th scope="col" style="padding: 1px;">Some text</th>
            <th scope="col" style="padding: 1px;">&nbsp;Project A</th>
            <th scope="col" style="padding: 1px;">Project B (some more info)</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <th scope="row" style="padding: 1px;">More text</th>
            <td style="padding: 1px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit</td>
            <td style="padding: 1px;">ELorem ipsum dolor sit amet, consectetur</td>
        </tr>
        <tr>
            <th scope="row" style="padding: 1px;">Lorep 1</th>
            <td style="padding: 1px;">Lorem ipsum dolor sit amet, consectetur</td>
            <td style="padding: 1px;">orem ipsum dolor sit amet, consectetur</td>
        </tr>
        <tr>
            <th scope="row" style="padding: 1px;">Even more text&nbsp;</th>
            <td style="padding: 1px;">Required behavioral<br>
            adoption</td>
            <td style="padding: 1px;">Encroaching on the land&nbsp;and rights of local communities, labour right violations</td>
        </tr>
        <tr>
            <th scope="row" style="padding: 1px;">Some numbers</th>
            <td style="padding: 1px;">32</td>
            <td style="padding: 1px;">32</td>
        </tr>
    </tbody>
</table>
<br>
We now ask you several questions on these proposed projects.<br> </p>
&nbsp;</div>`
;

// This is important, otherwise, the element you add will be at the back
base_element.style.zIndex = 1;
new_element.style.zIndex = 10;

});

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @C3row
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: canIchangethis