border

書式

オブジェクト.style.border

説明

枠(ボーダー)を参照/設定します。

サンプルコード [実行]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<script type="text/javascript"><!--
function changeCSS() {
document.getElementById("result").style.border = "4px solid red";
}
// --></script>
</head>
<body>
<div id="result">Sample text</div>
<form>
<input type="button" value="Change" onClick="changeCSS()">
</form>
</body>
</html>