Hi @Carolinedavies ,
Can you be more specific as to what kind Question setup you are using or share a screenshot as the code will be dependent on it .
Just decrease the margin in betweek question text. You may try below code but change different css values like padding or margin.
jQuery('q-text-entry').css(‘margin-top’,’0px’)
Hi @Carolinedavies
1. Below is the JS code to add static text:-
Qualtrics.SurveyEngine.addOnReady(function() {
// Get the text entry question element
var textEntryQuestion = jQuery('#QID1');
// Add static text above the text entry box
textEntryQuestion.prepend('<p>This is the static text above the text entry box.</p>');
});
2. Below is the CSS to remove the space. Replace QID1 with the actual ID of your text entry question.:-
.QID1 .QuestionText {
margin-bottom: 0; /* Remove bottom margin from question text */
}
.QID1 .InputText {
margin-top: 0; /* Remove top margin from text entry box */
}
you can achieve this by using JavaScript to manipulate the layout or content of your survey questions.
This JavaScript code that you can use to add static text directly above a text entry:
box:Qualtrics.SurveyEngine.addOnload(function() {
// Get the question container element
var questionContainer = jQuery('.QuestionText');
// Create a new element for your static text
var staticText = document.createElement('div');
staticText.innerHTML = 'Your static text goes here';
// Insert the static text element before the question text
questionContainer.before(staticText);
});
Alternatively, if you want to eliminate the space between the question text and the text entry box, you can adjust the question spacing in Qualtrics without using JavaScript. Just Go to the question you want to modify now Edit the question. In the question editing window, click on the "Layout" tab and Adjust the "Question Spacing" option to reduce or eliminate the space between the question text and the input box.