First Attempt at Manipulating-DOM-jQuery

Hi Zee.  I'm not 100% sure what this exercise is trying to teach me.  Why do they want to insert all of the HTML into the index.html page with JavaScript?

Anyway, I'm interested in getting your feedback.
Zee, 
In the js console, I am using the textContent property in this way to get the text of a tag but it returns "undefined". am I using it correctly? thanks,m 
document.getElementsByClassName("blablabla").textContent 


----- Original Message -----

From: "Zee" <notifications@github.com> 
To: "OdinProject-GrowingDevelopers/Manipulating-DOM-jQuery" <Manipulating-DOM-jQuery@noreply.github.com> 
Sent: Thursday, August 21, 2014 4:00:01 PM 
Subject: Re: [Manipulating-DOM-jQuery] First Attempt at Manipulating-DOM-jQuery (#1) 



In main.js: 
> +  section.addClass('black-background').html(aboutUs);
> +}
> +
> +function homeTab () {
> +  $('.black-background').removeClass('black-background').html('<div class="description"><h2>Featuring a full menu of authentic traditional Spanish cuisine and tapas. Our customers can experience an extremely wide variety of dishes with memorable tastes.</h2></div>');
> +}
> +
> +function myCreateElement (element, attributes, html) {
> +  var elem = document.createElement(element);
> +  for (var key in attributes){
> +    elem.setAttribute(key, attributes[key]);
> +  }
> +  elem.innerHTML = html;
> +
> +  return elem;
> +} 


How about just createElement and rename the element argument to tag since that's what you're actually passing in. 

— 
Reply to this email directly or view it on GitHub .