HTML DOM 바디 배경 속성
정의 및 사용
배경 속성 집합 또는 신체 요소 배경 속성의 값을 반환합니다.
배경 속성은 문서의 배경 이미지를 설명한다.
문법
bodyObject.background=URL
브라우저 지원
모든 주요 브라우저 배경 속성을 지원합니다.
예
예
본체 부재의 배경 속성 반환
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body id="logo" background="logo.png">
<script>
document.write("背景图片是: ")
document.write(document.getElementById("logo").background);
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body id="logo" background="logo.png">
<script>
document.write("背景图片是: ")
document.write(document.getElementById("logo").background);
</script>
</body>
</html>
»시도
바디 개체