I have to access CSS class by name, and the code below works. However if I try hui[\"myclass\"] or hui[\".myclass\"] instead of hui[0]
hui[\"myclass\"]
hui[\".myclass\"]
hui[0]
Yes, Bergi is right: You first have to build an index for the style list. BUT take care: If there is more than 1 stylesheet you first have to loop over the stylesheets. So I like to improve Bergis solution:
var styleBySelector = {}; for (var j=0; j