Doubt about HTML code along with JS

Asked

Viewed 32 times

0

Good morning guys, I have a question here. I’m doing some 'Alura' exercises, only to make it nice and organized here for me, I decided to put so that when he executed the index he showed the activity question along with the answer, only that in the question and answer has the html/js code together and wanted to know how to make it appear on the index page.

Code with question and answer is as follows.

<meta charset="UTF-8">
Atividado Tapando buraco
<br>
Amanda esteve muito ocupada e não teve tempo de finalizar um trabalho em grupo.<br>
 Seus amigos, desesperados, precisam terminar o programa para conseguirem um ponto que pode ajudá-los a passar na matéria. <br>
 O código era o seguinte:
<meta charset="UTF-8">
<script>
     document.write ("<br>");
    document.write("O resultado da fórmula é : " + n * (10 / 20)  );
    document.write ("<br>");
</script>


<script>
     document.write ("<br>");
     document.write ( "Resposta da atividade");
     document.write ("<br>");
     document.write ("O resultado da fórmula é :" + (5*(10/20)) + " resul." );
</script>

  • You want to display code fragment as text on the page?

  • that’s, that’s exactly it.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.