この例では、主に2つのパラメーターとonfocusを学習します。これらの2つのパラメーターが以前に遭遇することはめったにないため、BaiduはOnblurがコントロールが焦点を失ったときにトリガーされるイベントであり、Onfocusは入力フォーカスになったときにトリガーされるイベントであることを理解しています。両方のパラメーターをクラス名と組み合わせて、スタイルシートクラス名を直接呼び出すことができます。
<!doctype html public - // w3c // dtd html 4.01 transitional // en http://www.w3.org/tr/html4/loose.dtd> <html> <head> <メタhttp-equiv = content-type content = text/html; charset = gb2312> <title> </title> </head> <body> <style type = text/css> .input1 { フォントファミリー:Verdana; Background-color:#eeeeee; border-bottom:#fffff 1px solid; border-left:#cccccc 1px solid; border-right:#fffff 1px solid; border-top:#ccccc 1px solid; font-size:12px; } .input1-bor { Font-Family:Verdana; Background-color:#f0f8ff; font-size:12px; 国境:1pxソリッド#333333;} </style> <Table CellPacing = 2 CellPading = 0幅= 300 Border = 0> <tr> <td> <font class = en1>名前:</font> </td> <td> <入力サイズ= 40 name = name class = input1 onblur = this.classname = 'input1' onfocus = this.classname = 'input1-bor'> </td> </tr> <tr> <td> <font class = en1>メール:</font> </td> <td> <入力サイズ= 40 name = email class = input1 onblur = this.classname = 'input1' onfocus = this.classname = 'input1-bor'> </td> </tr> <tr> <td> <font class = en1>ウェブサイト:</font> </td> <td> <入力サイズ= 40 name = url class = input1 onblur = this.classname = 'input1' onfocus = this.classname = 'input1-bor'> </td> </tr> <tr> <td> <font class = en1>テーマ:</font> </td> <td> <入力サイズ= 40 name = subject class = input1 onblur = this.classname = 'input1' onfocus = this.classname = 'input1-bor'> </td> </tr> <tr> <td> <font class = en1>コンテンツ:</font> </td> <td> <textarea name = message rows = 5 cols = 35 class = input1 onblur = this.classname = 'input1' onfocus = this.classname = 'input1-bor'> </textarea> </td> </tr> </table> </body> </html> |