I want to have
document.body.innerHTML
or
document.head.innerHTML
I tried the obvious:
document.variable.innerHTML
but no go. Also want it to pass jshint.com
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try
The
.notation requires the property name to be a valid identifier, and a constant. Object property names, however, can be any string. Thus, whenever you have a property name that’s an “ugly” string, or a string held in a variable (or computed by some expression), you use the[ ]operator to access it.