The HTML output generated by The above code is below
<li class="ui-selectcheckboxmenu-item ui-selectcheckboxmenu-list-item ui-corner-all ui-selectcheckboxmenu-unchecked">
<div class="ui-chkbox ui-widget">
<div class="ui-helper-hidden-accessible"><input role="checkbox" readonly="readonly" aria-checked="false" type="checkbox"></div>
<div class="ui-chkbox-box ui-widget ui-corner-all ui-state-default ui-state-disabled">
<span class="ui-chkbox-icon ui-icon ui-icon-blank"></span>
</div>
</div>
<label>A</label>
</li>
<li class="ui-selectcheckboxmenu-item ui-selectcheckboxmenu-list-item ui-corner-all ui-selectcheckboxmenu-unchecked">
<div class="ui-chkbox ui-widget">
<div class="ui-helper-hidden-accessible"><input role="checkbox" readonly="readonly" aria-checked="false" type="checkbox"></div>
<div class="ui-chkbox-box ui-widget ui-corner-all ui-state-default">
<span class="ui-chkbox-icon ui-icon ui-icon-blank"></span>
</div>
</div>
<label>C</label>
</li>
The difference between two element is ui-state-disabled
class only.
Now we need one simple java script which go throw all <li>
element and look for that CSS class if found we come on outer HTML and then we can assign to our custome CSS class to <label>
.
Our Java Script code should run after page load.
This is just and idea, it will work, we need some time to implement and some level of java script.
If you have any suggestion please write down.
I am trying to write java script for that once it done will post here.
Edited:
<script type="text/javascript">
var lis = document.getElementById("myDiv").getElementsByTagName("li");
for(var i=0; i<lis.length;i++){
var innerdiv = lis[i];
var aa = lis[i].getElementsByClassName("ui-state-disabled");
if(aa.length == 1){
lis[i].classList.add('test');
}
}
</script>
I am not java script developer you may reduce the code. but this code should run after page load.
thanks
Ankush