Selecting text in label - Not working in Chrome

I want to select text that is displayed as label and then apply highlight to the selected text. I am able to select the text in Firefox but not in Chrome or Safari. How to fix this? (I am only needing help with selection of text that is part of the label, I can then apply highlight to it). Thanks.

If i anderstood you clear, you can try the next:

{type: "label", label: "New project <span style='background-color: yellow'> part of highlight effect</span>"},

It works in Chrome

I am not trying to set the property during label definition. I want user to be able to select the text after the form and label has been rendered and then change it to highlight. Here is the code that I want to use but the browser does not allow selection of text and window.getSelection does not return anything in Chrome but the same code works just fine in Firefox -

function highlight(colour) {
var seltext;
var range, sel;
if (window.getSelection) {
// IE9 and non-IE

    try {
        if (!document.execCommand("BackColor", false, colour)) {
            sel = makeEditableAndHighlight(colour);
    } catch (ex) {
        sel = makeEditableAndHighlight(colour)
} else if (document.selection && document.selection.createRange) {
    // IE <= 8 case
    range = document.selection.createRange();
    range.execCommand("BackColor", false, colour);
    sel = document.selection();

return sel;


function makeEditableAndHighlight(colour) {
var range, sel = window.getSelection();
if (sel.rangeCount && sel.getRangeAt) {
range = sel.getRangeAt(0);
document.designMode = “on”;
if (range) {

if (!document.execCommand("HiliteColor", false, colour)) {
    document.execCommand("BackColor", false, colour);
document.designMode = "off";
return sel;


Please, provide the following details: suite type (pro/std), version; are you using compiled dhtmlx.js or stand-alone form.js ?
Or provide us completed demo. … leted_demo