+ 2

I want to use document.write to write something but it is not opening on web is ther any way to correct this or any alternative

14th Oct 2020, 5:49 PM
Charchit Dahiya
Charchit Dahiya - avatar
12 Réponses
+ 2
Please help
14th Oct 2020, 5:52 PM
Charchit Dahiya
Charchit Dahiya - avatar
+ 2
In w3school use of document.write example: document.write("<h1>Hello world</h1><p>Have a nice day</p>" ) Will display all what is between double quotes except html tags.To understand what is your problem or how to help you give more explanations or code source .
14th Oct 2020, 6:04 PM
HBhZ_C
HBhZ_C - avatar
+ 2
Please tell
14th Oct 2020, 6:22 PM
Charchit Dahiya
Charchit Dahiya - avatar
+ 2
Your code works fine just enter numbers to test for factor or not factor for example 8 then 2 will give it is a factor.
14th Oct 2020, 6:23 PM
HBhZ_C
HBhZ_C - avatar
14th Oct 2020, 6:17 PM
Charchit Dahiya
Charchit Dahiya - avatar
+ 1
This is the one when I launch it on sololearn web it doesn't run.
14th Oct 2020, 6:17 PM
Charchit Dahiya
Charchit Dahiya - avatar
+ 1
So I want to ask if there is any alternative to document.write. please rewrite the code if you know it. Thanks in advance
14th Oct 2020, 6:18 PM
Charchit Dahiya
Charchit Dahiya - avatar
+ 1
Use of innerHTML with onload function in html selector as div p or body tag <div onload="document.innerHTML(n)></div>
14th Oct 2020, 6:35 PM
HBhZ_C
HBhZ_C - avatar
+ 1
Please can you rewrite my code using inner html please it will be so great of you
14th Oct 2020, 6:36 PM
Charchit Dahiya
Charchit Dahiya - avatar
0
But if I try it in web then it does not works
14th Oct 2020, 6:24 PM
Charchit Dahiya
Charchit Dahiya - avatar
0
Can I use here innerhtml if I can then how please tell
14th Oct 2020, 6:25 PM
Charchit Dahiya
Charchit Dahiya - avatar
- 1
This one is what i can do of best https://code.sololearn.com/W0rAu3yJ6qRd/?ref=app
14th Oct 2020, 7:28 PM
HBhZ_C
HBhZ_C - avatar