विवरण
HTML DOM HR ऑब्जेक्ट HTML दस्तावेज़ के
तत्व को दर्शाता है।
HR ऑब्जेक्ट बनाएं
सिंटैक्स
document.createElement("HR");
उदाहरण
आइए hr ऑब्जेक्ट का एक उदाहरण देखें:
<!DOCTYPE html> <html> <style>
body {
text-align: center;
background-color: #fff;
color: #0197F6;
}
h1 {
color: #23CE6B;
}
.btn {
background-color: #fff;
border: 2px solid #0197F6;
height: 2rem;
width: 40%;
margin: 2rem auto;
display: block;
color: #0197F6;
outline: none;
cursor: pointer;
border-radius: 20px;
}
hr {
border-color: #db133a;
}
</style> <body>
<h1>DOM HR ऑब्जेक्ट डेमो</h1>
<button onclick="createHr()" class="btn">एक hr ऑब्जेक्ट बनाएं</button>
<script>
function createHr() {
var insElement = document.createElement("HR");
document.body.appendChild(insElement);
}
</script> </body> </html>
आउटपुट

"एक hr ऑब्जेक्ट बनाएं" बटन पर क्लिक करके एक hr ऑब्जेक्ट बनाएं।
