- Posts: 7
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Completed responseQuestion 1 - highlight all text yellow for label1 and green for label2:
This is a paragraph.
This is some text in a div element.
Example outputQuestion 1 - highlight all text yellow for label1 and green for label2:
This is a paragraph.
This is some text in a div element.
Please Log in to join the conversation.
// these two scripts add highlights <script type="text/javascript" charset="utf-8"> document.onmouseup = () => { sel = window.getSelection(); if (sel.rangeCount && sel.getRangeAt) { range = sel.getRangeAt(0); } // Set design mode to on document.designMode = "on"; if (range) { sel.removeAllRanges(); sel.addRange(range); } // Colorize text document.execCommand("BackColor", false, "#FF0011"); // Set design mode to off document.designMode = "off"; } </script><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> <script> // I want to append the selection to a long text response. $(document).ready(function(){ var whatiwant = window.getSelection().toString(); $("#answer{SGQ}").val(whatiwant).trigger('keyup'); }); </script>
Please Log in to join the conversation.