Skip to main content

htmlEnable

enables/disables rendering of HTML content (inner HTML) in Combobox options

htmlEnable?: boolean;
Default value: true

Example

const combo = new dhx.Combobox("combo_container", { 
htmlEnable: false, // disables render of HTML content
template: function (item) {
return "<div style='user-select:none; display: flex; justify-content: space-between;'>" +
"<span>" + item.value + "</span>" +
"<img style='height: 20px; width: 30px; border: 1px solid gray' src=" + item.src + "/></img>" +
"</div>";
}
});

When the property is set to true, the combobox displays the HTML content for its options but doesn't prevent XSS attacks.

You can disable rendering of the HTML content and display it as plain text via setting the property to false.

Related sample: Combobox. Disable HTML rendering

Change log:

added in v7.3