--
You received this message because you are subscribed to the Google Groups "General Open edX discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/646545f8-6147-4e34-8a05-6f10d7a13bd4%40googlegroups.com.
Andy Armstrong
edX | UI Architect | an...@edx.org
141 Portland Street, 9th floor
Cambridge, MA 02139
http://www.edx.org--
You received this message because you are subscribed to the Google Groups "General Open edX discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/7c729464-639a-400f-9b98-9f16e9be634b%40googlegroups.com.
Here's an example of the simplest case:
>><strong>1) Which is the correct syntax to create a paragraph element?</strong><<
( ) <code>createElement("p");</code>( ) <code>document.createElement("paragraph");</code>( ) <code>document.createElement("< p >");</code>(x) <code>document.createElement("p");</code>
[explanation]The <code>createElement</code> method is called from document. Pass in the name of the HTML element, but without the angle brackets.[explanation]>><strong>5) Consider the following HTML:</strong><<<pre><code class="language-javascript"><ul>	<li>Item one.</li>	<li>Item two.</li>	<li>Item three.</li>	<li>Item four.</li></ul></code></pre>
If the variable, <em>list</em>, points to that unordered list element, which of the following would point to the item labeled "Item two."?
( ) <code>list.childNodes[1];</code>( ) <code>list.firstChild.firstSibling;</code>(x) <code>list.children[1];</code>( ) <code>list.secondChild;</code>
[explanation]Be careful with properties that will return text nodes, such as <code>childNodes</code>, <code>firstChild</code>, and <code>firstSibling</code>. These children properties only return child elements.[explanation]