HTML DOM Strong 개체는 HTML 요소와 연결됩니다. 강한 태그는 강한 강조에 사용되며 텍스트를 굵게 만듭니다. createElement() 및 getElementById() 메서드를 각각 사용하여 강력한 요소를 만들고 액세스할 수 있습니다.
구문
다음은 −
의 구문입니다.강력한 개체 만들기 -
Var s= document.createElement("STRONG"); 예시
강한 객체에 대한 예를 살펴보겠습니다 -
<!DOCTYPE html>
<html>
<body>
<h1>Strong object example</h1>
<p>Create a strong element by clicking the below button</p>
<button onclick="createStrong">CREATE</button>
<p>This is some text inside the p element</p>
<script>
function createStrong() {
var s = document.createElement("STRONG");
var txt = document.createTextNode("This is some text inside the strong element");
s.appendChild(txt);
document.body.appendChild(s);
}
</script>
</body>
</html> 출력
이것은 다음과 같은 출력을 생성합니다 -

CREATE 버튼 클릭 시 -
