appendChild is not a function error (JAVASCRIPT)
<p>I have this piece</p>

<pre><code>var inviteSection = document.getElementByClassName("invitedFriends");
var friend = document.createElement("div").class = "friend";

var mail = document.createElement("p").class = "mail";
var span = document.createElement("span").class = "status accepted";

function main() {
    inviteSection.appendChild(friend);

    friend.appendChild(mail);
    friend.appendChild(span);
}

main();
</code></pre>

<p>When I run this chrome console it says <em>'Uncaught TypeError: inviteSection.appendChild is not a function'</em> Is there any fix for this please help me guys!</p>