JavaScript Display Possibilities
JavaScript can "display" data in different ways:
- Writing into an HTML element, using innerHTML.
- Writing into the HTML output using document.write().
- Writing into an alert box, using window.alert().
- Writing into the browser console, using console.log().
자바스크립트는 가능성을 보여준다?
자바스크립트는 몇가지 다른 방식으로 데이터를 표현할 수 있다.
innerHtml 을 사용함으로서 html 요소 안에 작성할수 있다.
document.write(). 를 사용함으로서 html 안에 작성할 수 있다.
window.alert(). 를 사용함으로서 경고 상자를 작성할 수 잇다.
console.log().를 사용함으로서 브라우저의 콘솔창에 작성할 수 있다.
Using innerHTML
To access an HTML element, JavaScript can use the document.getElementById(id) method.
The id attribute defines the HTML element. The innerHTML property defines the HTML content:
innerHtml
html 요소에 접근하기 위해선 자바스크립트는 the document.getElementById(id) 메소드를 사용할 수 잇다.
id 속성은 html 요소를 정의 한다. innerhtml 속성은 html 내용물을 정의한다.
Changing the innerHTML property of an HTML element is a common way to display data in HTML.
html 요소의 innerhtml 프로퍼티(일종의 메소드?)를 변경하는 것은 html 안에서 데이터를 표현하기 위해서 사용하는 일반적인 방법이다.
Using document.write()
For testing purposes, it is convenient to use document.write():
테스팅을 목적으로, document.write():를 사용하는 것은 편리하다.
Using document.write() after an HTML document is loaded, will delete all existing HTML:
html 문서가 로드된 후에 document.write() 사용하는 것은 존재하는 모든 html을 삭제할 것이다.
The document.write() method should only be used for testing.
document.write() 메소드는 오직 테스트를 위해서만 사용되어진다.
'영어공부' 카테고리의 다른 글
JavaScript Syntax (0) | 2020.01.23 |
---|---|
JavaScript Statements (0) | 2020.01.23 |
JavaScript Where To (0) | 2020.01.23 |
JavaScript Introduction (0) | 2020.01.23 |
JavaScript Tutorial (0) | 2020.01.22 |