Escape sequences in html_options?


I hate asking questions like this, but I swear I’ve been looking for the
answer for the better part of the morning.

I want to execute some javascript onChange for a select box, so I have:

:onchange=>“for (var x=1; x <= this.options.length; x++) {…}”

The problem is that the <= is being translated into <= and I don’t
that :-/. Nothing I’ve tried (various combinations of single/double
CGI::escape / unescape, etc…) seems to fix it. What I’m trying to
figure out is when exactly my < character is being translated, and
therefore what options I have for preventing that. I even tried putting
the whole thing in a CDATA section but that didnt seem to fly, either.