Home > documentオブジェクト > linkColorプロパティ
linkColorプロパティ
documentオブジェクトのlinkColorプロパティはリンクの色を返します。
書式 | document.linkColor |
ブラウザ | |
値 | リンクの色 |
<html>
<head>
<title>JavaScript linkColor</title>
<script>
function changeLC(color){
document.linkColor = color;
}
</script>
</head>
<body>
<form name="fm">
<a href="http://yahoo.co.jp/" title="Yahoo!!">Yahoo!!</a>
現在の文字色を変える<br>
<input type="button" value="赤色" onclick="changeLC('red')">
<input type="button" value="青色" onclick="changeLC('blue')">
<input type="button" value="黄色" onclick="changeLC('yellow')">
<input type="button" value="緑色" onclick="changeLC('green')">
</form>
</body>
</html>