Question: JavaScript and HTML fill in the 3 Blanks/Solutions. #1 Part 1 Assign newElement with a new li element. Assign textNode with a new TextNode containing
JavaScript and HTML fill in the 3 Blanks/Solutions.
#1 Part 1
Assign newElement with a new li element. Assign textNode with a new TextNode containing "Alex".
HTML code-
- Lisa
- John
- Jade
Javascript code-
var parentTag = document.getElementById('list');
/* Your solution goes here */
newElement.appendChild(textNode); parentTag.appendChild(newElement);
------------------------------------------------------------------------
#1 part 2
Assign jsonData with a JSON object with properties: studentName (a string), age (a number) and siblings (an array of strings). Note: The content of the properties doesn't matter.
Javascript-
var jsonData; /* Your solution goes here */
------------------------------------------------------------------------------
Store a new XMLHttpRequest object in the xhr variable, then assign xhrHandler function as the "load" event listener.
JavaScript-
function xhrHandler() { console.log("handling response: " + this.responseText); }
/* Your solution goes here */
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
