C
C
cytotv2017-06-17 15:31:47
JavaScript
cytotv, 2017-06-17 15:31:47

AppendChild doesn't want to work, what's wrong?

The code does not work, it gives: Uncaught TypeError: fieldchat.appenChild is not a function I've been breaking
my head for 2 hours, please help
HTML:

<ul class="chat" id="field-chat">
<li class="left clearfix">Element #1</li>
</ul>

JS:
var fieldchat = document.getElementById("field-chat");
var li = document.createElement("li");
li.innerHTML = "Element #2";
fieldchat.appenChild(li);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2017-06-17
@cytotv

Carefully read the text of the error and your code :) The word append lacks the letter d.
https://codepen.io/hogart/pen/bRgrNd

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question