documentにアクセスする

書式

$(document)

説明

documentにアクセスするには$(document)とします。

サンプルコード [実行]

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<link rel="stylesheet" href="main.css" type="text/css" media="all">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript"><!--
function changeTitle(){
$(document).title(new Date());
}
// --></script>
</head>
<body>
<h1>documentにアクセスする</h1>
<form>
<input type="button" value="ページタイトルを変更" onClick="changeTitle()">
</form>
</body>
</html>