0
I m learning javascript. When I write js. Codes on notepad it doesn't work. Why? Plz help!
7 Respostas
+ 3
Alian Jutt
document is an object and write is a function.
Object never start with capital letters so here Document will be wrong.
we call function from the object using dot (.) operator so there should not be space before the dot (.) operator.
So document. write is wrong because there is space before dot operator.
document. write //wrong (it will work but wrong calling)
document.write //right
+ 2
<script>
document.write("Hello World!");
</script>
+ 1
Alian Jutt String value should be in double quotes " "
document.write(Hello) // wrong, here Hello will be consider as variable
document.write("Hello") //right, here Hello will be consider as String
+ 1
Thanks AJ Anant you are genious
0
Alian Jutt Where is your Code? How did you write?
0
I write
Document. write(Hello)
As told by this app.
0
Thanks dear