ออบเจ็กต์ชื่อ HTML DOM ใน HTML แสดงถึงองค์ประกอบ
</P> <p>
การสร้าง<strong> <title></strong> องค์ประกอบ</P> <pre>var titleObject = document.createElement(“TITLE”)</pre> <p>
ที่นี่ “<strong>titleObject”</strong> สามารถมีคุณสมบัติดังต่อไปนี้ −</P> <table><thead><tr valign="TOP"><th>คุณสมบัติ <br> </th> <th>คำอธิบาย <br> </th> </tr> </thead> <tbody><tr valign="TOP"><td width="200">ข้อความ <br> </td> <td width="371">Itsets/returns ค่าของ <title> องค์ประกอบของเอกสาร <br> </td> </tr> </tbody> </table> <p>
เรามาดูตัวอย่าง<strong>ข้อความชื่อเรื่อง</strong> ทรัพย์สิน −</P> <h2>ตัวอย่าง</h2> <pre><!DOCTYPE html>
<html>
<head>
<title id="titleSelect">HTML DOM Title text</title>
<style>
form {
width:70%;
margin: 0 auto;
text-align: center;
}
* {
padding: 2px;
margin:5px;
}
input[type="button"] {
border-radius: 10px;
}
</style>
</head>
<body>
<form>
<fieldset>
<legend id="legendSelect"></legend>
<input type="button" onclick="getTitleText()" value="What's the title of document?">
<div id="divDisplay"></div>
</fieldset>
</form>
<script>
var divDisplay = document.getElementById("divDisplay");
var legendSelect = document.getElementById("legendSelect");
var titleSelect = document.getElementById("titleSelect");
function getTitleText() {
divDisplay.textContent = 'Title of document: '+titleSelect.text;
legendSelect.textContent = titleSelect.text.split(' ').join('-');
}
</script>
</body>
</html></pre> <h2>ผลลัพธ์</h2> <p>
ก่อนคลิก <strong>'ชื่อเอกสารคืออะไร'</strong> ปุ่ม −</P> <p>
<img loading='lazy' alt='ออบเจ็กต์ชื่อ HTML DOM ' src="/article/uploadfiles/202203/2022033116532137.jpg" /></P> <p>
หลังจากคลิก <strong>'ชื่อเอกสารคืออะไร'</strong> ปุ่ม −</P> <p>
<img loading='lazy' alt='ออบเจ็กต์ชื่อ HTML DOM ' src="/article/uploadfiles/202203/2022033116532123.jpg" /></P> <br>
</article>
<div class="ad ad5">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4480737146802772" crossorigin="anonymous"></script><!-- computer.wsxdn --><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4480737146802772" data-ad-slot="4467655591" data-ad-format="auto" data-full-width-responsive="true"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>
</div>
<section id="turn-page" class="t-over">
<div class="f-start f-align">
<i><img loading='lazy' src="https://th.wsxdn.com/css/img/sanjiao.svg" alt=""></i>
<a class='LinkPrevArticle' href='https://th.wsxdn.com/db044w/zx451s/1004065366.html' >คุณสมบัติ HTML DOM ชื่อเรื่อง </a>
</div>
<div class="f-start f-align">
<i><img loading='lazy' src="https://th.wsxdn.com/css/img/sanjiao.svg" alt=""></i>
<a class='LinkNextArticle' href='https://th.wsxdn.com/db044w/zx451s/1004065368.html' >คุณสมบัติเหตุการณ์ประทับเวลา HTML DOM </a>
</div>
</section>
<section class="box1-3">
<ol class="f-between">
<li class="aList-2 aList f-between f-align">
<div>
<a href="https://th.wsxdn.com/db044w/zx451s/1004064995.html" class="title">
<p class="r-over r-over-2" title="วัตถุรายละเอียด HTML DOM ">
วัตถุรายละเอียด HTML DOM </p>
</a>
</div>
</li><li class="aList-2 aList f-between f-align">
<div>
<a href="https://th.wsxdn.com/db044w/zx451s/1004065091.html" class="title">
<p class="r-over r-over-2" title="HTML DOM Textarea วัตถุ ">
HTML DOM Textarea วัตถุ </p>
</a>
</div>
</li><li class="aList-2 aList f-between f-align">
<div>
<a href="https://th.wsxdn.com/db044w/zx451s/1004065239.html" class="title">
<p class="r-over r-over-2" title="วัตถุ HTML DOM HR ">
วัตถุ HTML DOM HR </p>
</a>
</div>
</li><li class="aList-2 aList f-between f-align">
<div>
<a href="https://th.wsxdn.com/db044w/zx451s/1004065382.html" class="title">
<p class="r-over r-over-2" title="HTML DOM Ul Object ">
HTML DOM Ul Object </p>
</a>
</div>
</li>
</ol>
</section>
</section>
<aside class="box-r">
<section class="box4-1">
<strong>
HTML
</strong>
<ol>
<li class="f-start">
<i>
<img loading='lazy' src="https://th.wsxdn.com/css/img/article-lan.svg" alt="">
</i>
<a href="https://th.wsxdn.com/db044w/zx451s/1004064435.html" title="HTML DOM HTML Object ">
<p class="r-over r-over-2">HTML DOM HTML Object </p>
</a>
</li>
<li class="f-start">
<i>
<img loading='lazy' src="https://th.wsxdn.com/css/img/article-lan.svg" alt="">
</i>
<a href="https://th.wsxdn.com/db044w/zx451s/1004064541.html" title="วัตถุพารามิเตอร์ HTML DOM ">
<p class="r-over r-over-2">วัตถุพารามิเตอร์ HTML DOM </p>
</a>
</li>
<li class="f-start">
<i>
<img loading='lazy' src="https://th.wsxdn.com/css/img/article-lan.svg" alt="">
</i>
<a href="https://th.wsxdn.com/db044w/zx451s/1004064542.html" title="วัตถุสคริปต์ HTML DOM ">
<p class="r-over r-over-2">วัตถุสคริปต์ HTML DOM </p>
</a>
</li>
<li class="f-start">
<i>
<img loading='lazy' src="https://th.wsxdn.com/css/img/article-lan.svg" alt="">
</i>
<a href="https://th.wsxdn.com/db044w/zx451s/1004064643.html" title="วัตถุ HTML DOM S ">
<p class="r-over r-over-2">วัตถุ HTML DOM S </p>
</a>
</li>
<li class="f-start">
<i>
<img loading='lazy' src="https://th.wsxdn.com/css/img/article-lan.svg" alt="">
</i>
<a href="https://th.wsxdn.com/db044w/zx451s/1004064661.html" title="ออบเจ็กต์สรุป HTML DOM ">
<p class="r-over r-over-2">ออบเจ็กต์สรุป HTML DOM </p>
</a>
</li>
</ol>
</section>
<ul>
<li class="f-start f-align">
<a href="https://th.wsxdn.com/db044w/zx451s/1004064859.html" class="i-text"><p class="r-over r-over-3">วัตถุ HTML DOM dl </p></a>
</li>
<li class="f-start f-align">
<a href="https://th.wsxdn.com/db044w/zx451s/1004064876.html" class="i-text"><p class="r-over r-over-3">ออบเจ็กต์ส่วนหัว HTML DOM </p></a>
</li>
<li class="f-start f-align">
<a href="https://th.wsxdn.com/db044w/zx451s/1004064877.html" class="i-text"><p class="r-over r-over-3">วัตถุส่วนหัว HTML DOM </p></a>
</li>
<li class="f-start f-align">
<a href="https://th.wsxdn.com/db044w/zx451s/1004064887.html" class="i-text"><p class="r-over r-over-3">HTML DOM เน้นวัตถุ </p></a>
</li>
<li class="f-start f-align">
<a href="https://th.wsxdn.com/db044w/zx451s/1004064894.html" class="i-text"><p class="r-over r-over-3">วัตถุ HTML DOM ส่วนท้าย </p></a>
</li>
</ul>
<ul class="types f-between">
<li><a class='childclass' href='https://th.wsxdn.com/db044w/hf444z/' target="_self">การเขียนโปรแกรม C</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/bz445u/' target="_self">C++</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/tr446l/' target="_self">Redis</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/rp447j/' target="_self">การเขียนโปรแกรม BASH</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/wu448o/' target="_self">Python</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/nl449f/' target="_self">Java</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/ig450a/' target="_self">ฐานข้อมูล</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/zx451s/' target="_self">HTML</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/ec452w/' target="_self">Javascript</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/db453v/' target="_self">การเขียนโปรแกรม</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/if454a/' target="_self">CSS</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/ge455y/' target="_self">Ruby</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/xv456p/' target="_self">SQL</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/jh457b/' target="_self">IOS</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/om458g/' target="_self">Android</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/mk459f/' target="_self">MongoDB</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/rp460j/' target="_self">MySQL</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/qn461i/' target="_self">C#</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/jh465b/' target="_self">PHP</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/kh471c/' target="_self">SQL Server</a></li>
</ul>
</aside>
</section>
<footer>
<section class="msg f-center container">
<span class="f-start">
ลิขสิทธิ์ ©
<a href="https://th.wsxdn.com">https://th.wsxdn.com</a>
สงวนลิขสิทธิ์
</span>
</section>
</footer>
</body>
</html>