pタグで囲まれた文字を・・・
- カーソルの形を変える
- クリック時にメッセージ表示
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>DOMによる要素の指定</title> <!--[if lte IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <!--[if lte IE 9]> <script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script> <![endif]--> </head> <body> <p id="myId">おしてね</p> <script> var obj = document.getElementById("myId"); obj.onmouseover = function(){ this.style.cursor="pointer"; }; obj.onclick= function(){ alert( '押されました' ); }; </script> </body> </html>