Computer >> 컴퓨터 >  >> 프로그램 작성 >> HTML

HTML DOM 제목 텍스트 속성

<시간/>

HTML DOM Title 텍스트 속성은 문서의 요소 값을 설정/반환합니다.</P> <p> 다음은 구문입니다 -</P> <p> 문자열 값 반환</P> <pre>titleElementObject.text</pre> <p> <strong>텍스트</strong> 설정 문자열 값으로</P> <pre>titleElementObject.text = string</pre> <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/2022033116531801.jpg" /></P> <p> <strong>'문서 제목이 무엇인가요?'</strong>를 클릭한 후 버튼 -</P> <p> <img loading='lazy' alt='HTML DOM 제목 텍스트 속성 ' src="/article/uploadfiles/202203/2022033116531831.jpg" /></P> <br> </article> <div class="ad5"> <script language='javascript' src='https://kr.wsxdn.com/css/ad/kr2.js'></script> </div> <div id="turn-page" class="text-over"> <a class='LinkPrevArticle' href='https://kr.wsxdn.com/bz024t/hf251z/1002065364.html' >HTML DOM 터치 취소 이벤트 </a> <a class='LinkNextArticle' href='https://kr.wsxdn.com/bz024t/hf251z/1002065366.html' >HTML DOM 제목 속성 </a> </div> </section> <aside class="box-r box4-r"> <h3>HTML</h3> <ul> <li> <a href="https://kr.wsxdn.com/bz024t/hf251z/1002064426.html" class="f-start"> <em></em> <p class="r-over r-over-2" title="HTML DOM innerText 속성 ">HTML DOM innerText 속성 </p> </a> </li><li> <a href="https://kr.wsxdn.com/bz024t/hf251z/1002064451.html" class="f-start"> <em></em> <p class="r-over r-over-2" title="HTML DOM 옵션 텍스트 속성 ">HTML DOM 옵션 텍스트 속성 </p> </a> </li><li> <a href="https://kr.wsxdn.com/bz024t/hf251z/1002064583.html" class="f-start"> <em></em> <p class="r-over r-over-2" title="HTML DOM 스타일 textOverflow 속성 ">HTML DOM 스타일 textOverflow 속성 </p> </a> </li><li> <a href="https://kr.wsxdn.com/bz024t/hf251z/1002064584.html" class="f-start"> <em></em> <p class="r-over r-over-2" title="HTML DOM 스타일 textIndent 속성 ">HTML DOM 스타일 textIndent 속성 </p> </a> </li><li> <a href="https://kr.wsxdn.com/bz024t/hf251z/1002064586.html" class="f-start"> <em></em> <p class="r-over r-over-2" title="HTML DOM 스타일 textDecorationLine 속성 ">HTML DOM 스타일 textDecorationLine 속성 </p> </a> </li> </ul> <h3 class="h3-2">컴퓨터</h3> <ul> <li> <a href="https://kr.wsxdn.com/bz024t/hf251z/1002064588.html" class="f-start"> <em></em> <p class="r-over r-over-2" title="HTML DOM 스타일 textDecoration 속성 ">HTML DOM 스타일 textDecoration 속성 </p> </a> </li> <li> <a href="https://kr.wsxdn.com/bz024t/hf251z/1002064649.html" class="f-start"> <em></em> <p class="r-over r-over-2" title="HTML DOM 스타일 공백 속성 ">HTML DOM 스타일 공백 속성 </p> </a> </li> <li> <a href="https://kr.wsxdn.com/bz024t/hf251z/1002064652.html" class="f-start"> <em></em> <p class="r-over r-over-2" title="HTML DOM 스타일 userSelect 속성 ">HTML DOM 스타일 userSelect 속성 </p> </a> </li> <li> <a href="https://kr.wsxdn.com/bz024t/hf251z/1002064653.html" class="f-start"> <em></em> <p class="r-over r-over-2" title="HTML DOM 입력 텍스트 값 속성 ">HTML DOM 입력 텍스트 값 속성 </p> </a> </li> <li> <a href="https://kr.wsxdn.com/bz024t/hf251z/1002064654.html" class="f-start"> <em></em> <p class="r-over r-over-2" title="HTML DOM 입력 텍스트 유형 속성 ">HTML DOM 입력 텍스트 유형 속성 </p> </a> </li> </ul> </aside> </section> </div> <ul class="types box4-1 container f-center"> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/ol244g/' target="_self">C 프로그래밍</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/fd245y/' target="_self">C++</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/xv246p/' target="_self">Redis</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/ig247a/' target="_self">BASH 프로그래밍</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/ge248y/' target="_self">Python</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/jh249b/' target="_self">Java</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/yw250q/' target="_self">데이터 베이스</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/hf251z/' target="_self">HTML</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/ig252a/' target="_self">JavaScript</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/qo253i/' target="_self">프로그램 작성</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/vs254n/' target="_self">CSS</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/fd255x/' target="_self">Ruby</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/ay256s/' target="_self">SQL</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/yw257q/' target="_self">IOS</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/wu258o/' target="_self">Android</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/nl259f/' target="_self">MongoDB</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/mk260e/' target="_self">MySQL</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/ax261s/' target="_self">C#</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/bz265t/' target="_self">PHP</a></li> <li><a class='childclass' href='https://kr.wsxdn.com/bz024t/zx271r/' target="_self">SQL Server</a></li> </ul> <footer> <section class="container"> <div class="footer-msg"> <span class="container f-center"> <p class=krf>저작권 © <a href="https://kr.wsxdn.com">https://kr.wsxdn.com</a> 모든 권리 보유</p> </span> </div> </section> </footer> </body> </html>