00:03:09 Zac Gordon: https://github.com/zgordon/wcdc-2017/blob/master/01-The-DOM/04-creating-and-appending.html 00:07:31 Zac Gordon: https://github.com/zgordon/wcdc-2017/blob/master/01-The-DOM/04-creating-and-appending.html 00:08:02 Zac Gordon: 1. TRUE / FALSE - The DOM is part of Vanilla JavaScript 00:25:05 michaelbui: var pText = document.createTextNode( 'Article content' ), pElement = document.createElement( 'p' ), divElement = document.createElement( 'div' ), h2Element = document.createElement( 'h2' ), aText = document.createTextNode( 'Article Title 4'), aElement= document.createElement( 'a' ), articleElement = document.createElement( 'article' ), divMain = document.querySelector( '#main' ); pElement.appendChild(pText); divElement.appendChild(pElement); aElement.appendChild(aText); h2Element.appendChild(aElement); articleElement.appendChild(h2Element); articleElement.appendChild(divElement); divMain.appendChild( articleElement ); 00:25:09 michaelbui: I got close 00:25:32 michaelbui: the a ref doesn’t have a link 00:25:37 michaelbui: I think I missed the HRF 00:25:39 michaelbui: HREF 00:34:57 jamesryan: var pText = document.createTextNode( 'Article content' ), pEl = document.createElement( 'p' ), divEl = document.createElement( 'div' ), h2El = document.createElement( 'h2' ), aText = document.createTextNode( 'Article Title 4'), aEl= document.createElement( 'a' ), articleEl = document.createElement( 'article' ), divGet = document.getElementById( 'main' ); pEl.appendChild(pText); divEl.appendChild (pEl); aEl.appendChild(aText); h2El.appendChild(aEl); articleEl.appendChild(h2El);articleEl.appendChild(divEl);divGet.appendChild( articleEl ); console.log( articleEl.innerHTML ); 00:35:13 jamesryan: This works but not fully what I wanted 00:36:04 jamesryan: I also missed href 00:37:14 Alfredo Navas: https://jsbin.com/cuwutuhelo/edit?html,output 00:37:31 jamesryan: var pText = document.createTextNode( 'Article content' ), pEl = document.createElement( 'p' ), divEl = document.createElement( 'div' ), h2El = document.createElement( 'h2' ), aText = document.createTextNode( 'Article Title 4'), aEl= document.createElement( 'a' ), articleEl = document.createElement( 'article' ), divGet = document.getElementById( 'main' ); pEl.appendChild(pText); divEl.appendChild (pEl); aEl.setAttribute( 'href', '#link' ); aEl.appendChild(aText); h2El.appendChild(aEl); articleEl.appendChild(h2El);articleEl.appendChild(divEl);divGet.appendChild( articleEl ); console.log( articleEl.innerHTML ); 00:37:40 jamesryan: That works now 00:38:55 Brezo: Yep, just ignore the mess 00:39:01 Brezo: https://codesandbox.io/s/937nm1k4qr 00:39:20 Brezo: On the html 00:39:30 Brezo: that is not the one 00:40:50 anjadeubzer: https://jsbin.com/qiqozan/edit?html,output 00:49:45 jamesryan: a.addEventListener("click", function(){ alert("Link clicked"); }); 00:51:49 jamesryan: document.getElementById("myBtn").addEventListener("click", function(){ alert("Click Me!"); }); 00:52:00 jamesryan: That one works 00:52:26 Zac Gordon: document.getElementById("myBtn").addEventListener("click", function(event){
 alert(event.target.innerText);
}); 00:52:36 jamesryan: Thanks Zac 00:57:09 Zac Gordon: https://github.com/zgordon/wcdc-2017 00:57:45 Zac Gordon: https://javascript30.com/ 01:00:03 Alfredo Navas: Got a run! 01:02:10 michaelbui: Hi belinda!! 01:02:12 michaelbui: thanks!!!