|  |||
|      Respuesta: Focalizar en un div    también con focus pero el div debe tener el atributo tabindex   Código HTML:  <html> <head> <title>Prueba</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script> $( function (){ $('div').focus( function (){ $(this).css('backgroundColor', 'red'); }).blur( function (){ $(this).css('backgroundColor', 'green'); }); }); </script> <style> div { width:200px; height:200px; background-color:blue; margin:5px} </style> </head> <body> <div tabindex="1"></div> <div tabindex="2"></div> </body> </html>  |  
  
  |  |||
|      Respuesta: Focalizar en un div    ok, igual podés agregarle con jquery   Código HTML:  <html> <head> <title>Prueba</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script> $( function (){ $('div').attr('tabindex', ''); $('div').focus( function (){ $(this).css('backgroundColor', 'red'); }).blur( function (){ $(this).css('backgroundColor', 'green'); }); }); </script> <style> div { width:200px; height:200px; background-color:blue; margin:5px} </style> </head> <body> <div></div> <div></div> </body> </html>  |