- Posts: 8
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // Add a class to the question $('#question{QID}').addClass('with-separator-options'); // Loop through all dropdowns in this question $('#question{QID} .answer-item select').each(function(i) { // Insert a separator before the option with value 1 $('option[value="1"]', this).before('<option value="" disabled>Separator 1</option>'); // Insert a separator before the option with value 5 $('option[value="5"]', this).before('<option value="" disabled>Separator 2</option>'); }); }); </script>
.with-separator-options .answer-item option { padding: 0 15px; } .with-separator-options .answer-item option:disabled { padding: 0; font-weight: bold; opacity: 1; color: #000000; }