New course! Every coder should learn Generative AI!
Try a free lesson+ 3
Farnaz.A
It is possible. Just don't use append function. Use document.write
See I have edited code again.
+ 3
Farnaz.A
appendChild is a function of JavaScript not jQuery. There is append function in jQuery.
+ 2
Farnaz.A
Use document.createElement() function to create new element and use appendChild() function to append that created element in any node element like body.
+ 2
Farnaz.A
No need to open document. You can directly use document.
You can create like this
https://code.sololearn.com/WzmooAA4Fnq2/?ref=app
+ 2
Farnaz.A
I just commented this line doc.open() and used append function
https://code.sololearn.com/WNdpNdNHat0J/?ref=app