javascriptはじめました - 2限目
inspired by javascriptはじめました - 2限目 - タケルンバ卿日記
承前⇒javascriptはじめました - finalventの日記
お題は、今、何時? (そうねだいたいね)
ほいじゃコード。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lamg="ja"> <head> <META http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> <META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 10.0.0.0 for Windows"> <META http-equiv="Content-Style-Type" content="text/css"> <script type="text/javascript"> var whattime = function() { (function(){ return document.getElementById(arguments[0]) } )("click_here").textContent = new Date().toLocaleDateString()+"です。"; }; </script> <title>今、何時?2</title> </head> <body> <h1>今、何時?</h1> <span id="click_here" onclick="whattime();">知りたい人はここをクリック</span> </body> </html>
れいによってFirefoxのみね。
Enjoy!