简体   繁体   中英

How to Change value of lable in qualtrics?

I want to change the value of the question lable in qualtrics from the default to something else. Please see the code below:

<label for="QR~QID8" class="QuestionText BorderColor">Click to write the question text</label>
 <h2 class="noStyle">
 <label for="QR~QID8" class="QuestionText BorderColor">Click to write the question text </label>
 </h2>
 <div class="QuestionBody">
 <div class="ChoiceStructure"> 
 <input autocomplete="off" id="QR~QID8" value="" class="InputText QR-QID8 QWatchTimer" name="QR~QID8~TEXT" data-runtime-textvalue="runtime.Value" type="TEXT"> 
 </div></div> 

so when my user answers the previous question. the question should change from "Click to write the question text" the the previous answer . For example if user gives ABC as an answer. The new question text should be "ABC" rather than "Click to write the question text"

Found the answer.

var label = document.querySelector('label[for="QR~QID8"]');
    label.textContent =document.getElementById('QR~QID2').value;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM