<html>
<body>
<h3>如何访问 FIGCAPTION 元素的演示</h3>
<figure>
<img src="/i/photo/tulip.jpg" alt="The Tulip" width="300" height="300">
<figcaption id="myFigCap">Fig.1 - 郁金香是百合科郁金香属的一个栽培种,又称洋荷花、旱荷花。</figcaption>
</figure>
<p>单击按钮将标题的颜色设置为红色。</p>
<button onclick="myFunction()">试一试</button>
<script>
function myFunction() {
var x = document.getElementById("myFigCap");
x.style.color = "red";
}
</script>
</body>
</html>