I want to know if it is possible to minimize this code by making a function, a loop or any other trick to avoid a block of code 26 lines.
$("#inputText").bind('keyup',function(objEvent){
switch(objEvent.keyCode)
{
case 65: $("div:contains('A')").attr("class", styledClass); break;
case 66: $("div:contains('B')").attr("class", styledClass); break;
...
case 90: $("div:contains('Z')").attr("class", styledClass);
}
})