- 전체
- HTML
- Web Design (웹디자인)
- XE 응용 개발
- wordpress plugin dev
- Javascript & JavaScript Application
- MEAN Stack : full stack javascript
- angular js & ionic framework
- bootstrap
- WebGL, Three.js and Babylon.js
- restful api design
- mobile web
- node.js 응용
- Cloud Service 응용
- 웹 어셈블리 개발 [WASM, WebAssembly]
- 마이크로서비스, MSA (microservice architecture)
- WebGL / WebGPU
- next.js 개발
- micro frontend (마이크로프론트앤드)
- 전자상거래/쇼핑몰
- 서버 클라우드 (aws, azure, google)
HTML html element text value html에선 .text 가 아니라 textContent 다
2019.01.03 00:25
html element text value
html element text value html에선
.text 가 아니라 textContent 다
HTML DOM textContent Property
Example
Get the text content of an element:
var x = document.getElementById("myBtn").textContent;
More "Try it Yourself" examples below.
Definition and Usage
The textContent property sets or returns the text content of the specified node, and all its descendants.
If you set the textContent property, any child nodes are removed and replaced by a single Text node containing the specified string.
Note: This property is similar to the innerText property, however there are some differences:
- textContent returns the text content of all elements, while innerText returns the content of all elements, exceptfor <script> and <style> elements.
- innerText will not return the text of elements that are hidden with CSS (textContent will).
Tip: Sometimes this property can be used instead of the nodeValue property, but remember that this property returns the text of all child nodes as well.
Tip: To set or return the HTML content of an element, use the innerHTML property.
[출처] https://www.w3schools.com/jsref/prop_node_textcontent.asp
본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 1 |
[AWS] 인프라/AWS VPC 구성 후 SSH 연결하기
| 졸리운_곰 | 2024.07.24 | 503 |

