HTML DOM S ऑब्जेक्ट HTML दस्तावेज़ के <s> तत्व को दर्शाता है।
आइए एक s ऑब्जेक्ट बनाएं:
वाक्य रचना (Syntax)
निम्नलिखित वाक्य रचना है:
document.createElement("S");
उदाहरण
आइए s ऑब्जेक्ट का एक उदाहरण देखें:
<!DOCTYPE html> <html> <head> <style>
body{
text-align:center;
background-color:#fff;
color:#0197F6;
}
h1{
color:#23CE6B;
}
.drop-down{
width:35%;
border:2px solid #fff;
font-weight:bold;
padding:8px;
}
.btn{
background-color:#fff;
border:1.5px dashed #0197F6;
height:2rem;
border-radius:2px;
width:60%;
margin:2rem auto;
display:block;
color:#0197F6;
outline:none;
cursor:pointer;
}
p{
font-size:1.2rem;
background-color:#db133a;
color:#fff;
padding:8px;
}
</style> </head> <body>
<h1>DOM S ऑब्जेक्ट डेमो</h1>
<button onclick="createS()" class="btn">एक s ऑब्जेक्ट बनाएं</button>
<script>
function createS() {
var sElement = document.createElement("S");
sElement.innerHTML="नमस्ते! मैं HTML में <s> तत्व हूँ";
document.body.appendChild(sElement);
}
</script> </body> </html>
आउटपुट
यह निम्न आउटपुट उत्पन्न करेगा:

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