click below
click below
Normal Size Small Size show me how
JAVASCRIPT WEEK 1
| Question | Answer |
|---|---|
| <script>..</script> | JavaScript tag |
| Document.getElementById("test") | Finds the html code with id test. |
| style.Display= 'none' | Hides text |
| style.fontSize=20px | Changes the font size of the letters |
| /**/ | Represents comments in JavaScript |
| What is the result of the code below? number=10; If number>50 document.write("Passed"); else document.write("Failed"); | Failed |
| What is the result of the code below? num=4; switch(num){ case 0: document.write("Zero number"); break; case 4: document.write("Positive number"); break; default: document.write("Other number");} | Positive number |
| The variable 'text' of the code below is global or local ? <script> var text="Hello" function helloFunction(txt){ document.write(txt); } helloFunction(text); </script> | Global |
| What does the code below check? If (num==0) | Checks if variable 'num' is equal to zero(0). |
| Var num= num1/num2; | Division between num1 and num2 |
| If number!=0 | Checks if the variable 'number' is not equal to 0 |