Try this:
function OnChangeCode()
{
jQuery("#description")[0].selectedIndex = jQuery("#code")[0].selectedIndex;
}
note : I think it's jQuery
instead of JQuery
Another way to do like the example:
1 - remove ->setAttrib('onChange','javascript: OnChangeCode();')
2 replace your function by :
$(function() {
$("#code").change(function() {
$("#description")[0].selectedIndex = $(this)[0].selectedIndex;
});
});