jqueryをはじめる
jQuery入門(その1) (1/7):CodeZine(コードジン)
を参考にjqueryを始めてみた。
会員登録しないと全部の記事が見れないみたいだから、続きはお家で。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html lang="ja"> <head> <title>jquery sample</title> <script src="scripts/jquery-1.3.2.min.js" type="text/javascript"></script> <script type="text/javascript"> <!-- $(function(){ $("#gdEntries").css("border", "solid 1px navy"); $(".gridalternate").css("background", "lightsteelblue"); $("#gdEntries>tbody>tr>td[id^=Pk]").css("background", "#DDFFCC"); }); $(function(){ $("input:text") .blur(function(){ $(this).css("backgroundColor", "white"); }) .focus(function(){ $(this).css("backgroundColor", "#FFCCDD"); }); $("input:button,input:submit") .click(function(event){ alert("clicked"); }); }); //--> </script> </head> <body> <table id="gdEntries"> <tr> <td>a</td> <td>b</td> </tr> <tr> <td id="Pk">c</td> <td id="Pk">d</td> </tr> </table> <table class="gridalternate"> <tr> <td>a</td><td>b</td> </tr> <tr> <td>c</td><td>d</td> </tr> </table> <input type="text"/> <input type="button" value="ボタン"/> </body> </html>