======Javascript HTML DOM innerText Property====== * description : Javascript HTML DOM innerText Property * author : 오션 * email : shlim@repia.com * lastupdate : 2021-06-07 \\ =====The source of the article==== [[https://www.w3schools.com/jsref/prop_node_innertext.asp|Javascript HTML DOM innerText Property]]\\ ====Example==== 요소의 내부 텍스트(inner text)를 가져옵니다.\\

Click the button to get the text content of the button element.

Note: The innerText property is not supported in Internet Explorer 9 and earlier.

=====Definition and Usage===== %%innerText%% 속성은 지정된 노드 및 모든 하위 항목의 텍스트 콘텐츠를 설정하거나 반환합니다.\\ \\ %%innerText%% 속성을 설정하면 모든 자식 노드가 제거되고, 지정된 문자열을 포함하는 단일 텍스트 노드로 대체됩니다.\\ \\ **Note:** 이 속성은 %%textContent%% 속성과 비슷하지만 몇 가지 차이점이 있습니다.\\ * %%textContent%%는 모든 요소의 텍스트 콘텐츠를 반환하는 반면, %%innerText%%는 **Tip:** 요소의 %%HTML%% 콘텐츠를 설정하거나 반환하려면 innerHTML 속성을 사용하세요.\\ =====Syntax===== 노드의 텍스트 콘텐츠를 반환합니다:\\ node.innerText \\ 노드의 텍스트 콘텐츠를 설정합니다:\\ node.innerText = text =====Property Values===== | Value ^ Type ^ Description ^ | text | String | 특정 노드의 텍스트 콘텐츠를 지정합니다. | =====Technical Details===== Return Value : 노드 및 모든 자손 항목의 "렌더링된" 텍스트 콘텐츠를 나타내는 문자열 =====More Examples===== ====Example==== 다음의 예제는 %%innerText, innerHTML, 그리고 textContent%% 사이의 일부 차이점을 보여줍니다.\\

Differnece between innerText, innerHTML, and textContent

This element has extra spacing, and contains a span element.

Note: The textContent property is not supported in Internet Explorer 8 and earlier, and the innerText property is not supportedin IE9 and earlier.

\\ 지정된 속성을 사용하여 위의 %%

%% 요소의 콘텐츠를 가져옵니다.\\ \\ **%%innerText%%** 반환 : "This element has extra spacing, and contains a span element."\\ **%%innerHTML%%** 반환 : " This element has extra spacing, and contains a span element."\\ **%%textContent%%** 반환 : " This element has extra spacing, and contains a span element."\\ %%innerText%% 속성은 공백 및 내부 요소 태그 없이 텍스트만 반환합니다.\\ %%innerHTML%% 속성은 모든 공백 및 내부 요소 태그를 포함하여 텍스트를 반환합니다.\\ %%textContent%% 속성은 간격은 있지만 내부 요소 태그는 없는 텍스트를 반환합니다.\\ {{tag>오션, Javascript HTML DOM innerText Property}}