blob: a7aa7249419fe57eade975a34be4021b8372df09 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
---
title: Document.linkColor
slug: Web/API/Document/linkColor
tags:
- API
- Deprecated
- Document
- HTML DOM
- Property
- Reference
- プロパティ
translation_of: Web/API/Document/linkColor
---
<div>{{APIRef("DOM")}} {{Deprecated_header}}</div>
<p><strong><code>Document.linkColor</code></strong> プロパティは、文書内のリンクの色を取得または設定します。</p>
<p>このプロパティは非推奨です。代替手段として、 CSS の {{cssxref("color")}} プロパティを HTML のアンカーリンク ({{HtmlElement("a")}}) または {{cssxref(":link")}} 疑似クラスで設定することができます。もう一つの代替手段に <code>document.body.link</code> がありますが、これは <a class="external" href="http://www.w3.org/TR/html401/struct/global.html#adef-link">HTML 4.01 で非推奨になりました</a>。</p>
<h2 id="Syntax" name="Syntax">構文</h2>
<pre class="syntaxbox"><var>color</var> = document.linkColor
document.linkColor = <var>color</var>
</pre>
<h3 id="Parameters" name="Parameters">引数</h3>
<ul>
<li><code><var>color</var></code>: 色を単語 (例えば <code>red</code>) または16進値 (例えば <code>#ff0000</code>) で表す文字列。</li>
</ul>
<h2 id="Example" name="Example">例</h2>
<pre class="brush:js">document.linkColor = 'blue';
</pre>
<h2 id="Specification" name="Specification">仕様書</h2>
<p>HTML5</p>
<p><code>Document.linkColor</code> は <a class="external" href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268">DOM Level 2 HTML で非推奨になりました</a>。</p>
<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの対応</h2>
<p>{{Compat("api.Document.linkColor")}}</p>
<p>Mozilla Firefox におけるこのプロパティの既定値は、青 (16進数で <code>#0000ee</code>) です。</p>
<h2 id="See_also" name="See_also">関連情報</h2>
<ul>
<li>{{domxref("document.vlinkColor")}}</li>
<li>{{domxref("document.alinkColor")}}</li>
</ul>
|