0

Can we make an exam questions with html + javascript? What's the script?

12th Dec 2017, 3:37 AM
Ilmi N. Mubarok
Ilmi N. Mubarok - avatar
8 odpowiedzi
+ 1
<html> <head> <title> Exam </title> </head> <body> <p id="question_text"> Why is this question so easy </p> <br /> <p id="answer"></p> <button class="btn" onClick="loadIn()" style="height:50vw;width:50vw;border-radius:50%;">Click Me </button> <script> function loadIn(){ target = document.getElementById ('answer'); target.innerHTML = "because ur teacher's too lazy"; }; </script> </body> </html>
16th Dec 2017, 1:13 PM
EnRico Lam
EnRico Lam - avatar
+ 1
1)ask them what would happen if they click the button
16th Dec 2017, 1:13 PM
EnRico Lam
EnRico Lam - avatar
+ 1
1) ANS nothing, because there should be a var infront of the target=document...... in order for the code to work
16th Dec 2017, 1:14 PM
EnRico Lam
EnRico Lam - avatar
+ 1
2) ask them why is it bad to use css in html
16th Dec 2017, 1:16 PM
EnRico Lam
EnRico Lam - avatar
+ 1
3) ask them to write a style sheet for the button, and you may also include some style attributes to elements with class attributes
16th Dec 2017, 1:18 PM
EnRico Lam
EnRico Lam - avatar
+ 1
3) ANS plz do it yourself
16th Dec 2017, 1:18 PM
EnRico Lam
EnRico Lam - avatar
0
alright thanks
16th Dec 2017, 2:06 PM
Ilmi N. Mubarok
Ilmi N. Mubarok - avatar