Question: Javascript: How to transform to innerHTML to display this document.write(name.substr(0,x)+ ); I want to use innerHTML instead. thanks here the code: javascript function myName(){ var
Javascript:
How to transform to innerHTML to display this document.write(name.substr(0,x)+" "); I want to use innerHTML instead. thanks
here the code:
function myName(){
var name = "Juliet"
for (x = 1; x <= name.length; x++){
document.write(name.substr(0,x)+" "); // this line to innerHTML
}
}
myName()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
