title: Is there a getElementById for style rules?
body: <p>Short question is all in the title.... TL;DR below.</p>
  
  <p><a href="https://stackoverflow.com/questions/23572766/change-stylesheet-rule-selector-dynamically">This question</a> and the comments talk about using the id on a style sheet containing a single rule as a clever technique for isolating styles that must change significantly, and works for changing both the selector and the style content.</p>
  
  <p>A case that seems like it would be more frequent to me would be just to change the content, and that can be done by referencing the cssRule.style.properties ... if the correct cssRule can be located.</p>
  
  <p>But individual style rules don't seem to have provision for an id, or a way to locate them among the (sometimes) hundreds of style rules in a style sheet (or collection of style sheets).</p>
  
  <p><a href="http://www.hunlock.com/blogs/Totally_Pwn_CSS_with_Javascript" rel="nofollow noreferrer">this link</a> talks about how to locate a rule by the selector text, but it seems one must match the selector text exactly, and that the implementation only finds the first rule with that selector text, although there could be more than one. The last one might be more useful to find, if the desire is to change a visible style.  Obviously the code could be tweaked to return the last, or to return an array... but sometimes the selector text gets atrociously long, too.</p>
  
  <p>Having a way to flag the particular rule that wants to be changed dynamically would seem to be useful. If the stylesheet is manipulated, keeping the array index would be a brittle, bug-susceptible way of finding it.</p>