To set a custom color for the text selection you should use the following technique:
<style> .my_style ::selection { color: #454544; background-color: #fffcda; } .my_style ::-moz-selection { color: #454544; background-color: #fffcda; } </style>
<div id="parentId"></div> <div id="objId"> King Arthur is a 2004 film directed by Antoine Fuqua ... </div> <div id="objId2" class="my_style"> King Arthur is a 2004 film directed by Antoine Fuqua ... </div> <script> var dhxLayout = new dhtmlXLayoutObject("parentId", "2U"); dhxLayout.cells("a").setText("Default selection"); dhxLayout.cells("b").setText("Custom selection"); dhxLayout.cells("a").attachObject("objId"); dhxLayout.cells("b").attachObject("objId2"); </script>