Jump to content
Fórum Script Brasil
  • 0

problema com codigo 'window.document.write()


Question

ola eu estou aprendendo a programar assistindo aulas no youtube no meio de uma das aulas o codigo não estava funcionando o window.document.write era  para estar escrevento a variavel p1 mas ele simplesmente não le o codigo acho que deve ser o getelement mas não sei como resolver e se é isto

 

 

 

 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>primeiros passos com o DOM</title>
<style>
    body{
        background#5892ff;
        color : white;
        fontnormal 18pt arial;
    }
</style>
</head>
<body>
<h1>iniciando estudos com o DOM</h1>
<P>aqui vai o resultado</P>
<p>aprendendo a usar o <strong>DOM</strong> em javascript</p>
<div>clique em mim</div>
<script>
 
var p1 = window.document.getElementsBytagName(p)[0]
window.document.write(p1.innerText);  
 
</script>
</body>
</html>
Edited by joao macedo
Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Cloud Computing


  • Forum Statistics

    • Total Topics
      149390
    • Total Posts
      645880
×
×
  • Create New...