Here's the code I am currently using.
function firstChildAge() {
var header = document.createElement('H1');
var body = document.getElementsByTagName('BODY');
var textnode = document.createTextNode("WHAT IS THE AGE OF THE FIRST CHILD?");
var inputChildOne = document.createElement("Input");
header.appendChild(textnode);
document.body.appendChild(header);
document.body.appendChild(inputChildOne);
}
a) How would I assign a variable value to the response created by the user to the Input?
b) How can I style elements inside Javascript? For example, how can I make the text "WHAT IS THE AGE OF THE FIRST CHILD?" red, or change the font size?
Thank you!!!
$("H1").css("color","red"). this can also be called inside a function and the function gets triggered by clicking a button or whatever