DOM
就像下面的程式码,DOM就是html、head、body、div、tr、td之类的。
<!doctype html><html lang="zh" dir="ltr"><head></head><body> <div id="custom-bg"></div> <div id="custom-bg-preview"></div> <!-- Container for the OneGoogleBar HTML. --> <div id="one-google"></div> ....</body></html>
而在我们撰写程式码时要用到的就是取得DOM元素的id位置document.getElementById('example'),将我们製作好的内容JSX型态的内容例:Hello放进去。
<div id="example"></div>ReactDOM.render(<div>Hello</div>,document.getElementById('example'));