javascript - black screen when loading html from text editor -


hi i'm new programming. have purchased book beginning javascript 4th edition , began working example on text editor 2013. i've changed preferences on text editor "plain text" , "display html." wrote example code out , tried load onto google chrome; however, getting black screen. can help? code:

<html>  <body bgcolor=“white”> <p>paragraph 1</p> <script type=“text/javascript”>     document.bgcolor = “red”; </script> </body> </html> 

i should getting red screen text "paragraph 1" in top-left corner of page.

you seemed have used wrong quotes in couple of places -

bgcolor=“white”>         ^     ^ 

replacing them correct quotes render properly.

try copy pasting , running block -

<html>  <body bgcolor="white"> <p>paragraph 1</p> <script type="  text/javascript">     document.bgcolor = "red"; </script> </body> </html> 

Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Website Login Issue developed in magento -

Can the constants be defined inside a model file of a framework in PHP? -