Javascript Questions and Answers
Javascript Quiz 1.Inside which HTML element do we put the JavaScript? a) javascript b) js c) script d) scripting - Answer-c) script 2. What is the correct JavaScript syntax to write "Hello World"? a) ("Hello World") b) "Hello World" c) ("Hello World") d) ("Hello World") - Answer-c) ("Hello World") 3. Where is the correct place to insert a JavaScript? a) Both the head section and the body section are correct b) The body section c) The head section - Answer-a) Both the head section and the body section are correct 4. What is the correct syntax for referring to an external script called ""? a) script src="" b) script name="" c) script href="" d) script value="" - Answer-a) script src="" 5. An external JavaScript must contain the script tag a) False b) True - Answer-a) False 6. How do you write "Hello World" in an alert box? a) alert("Hello World") b) msgBox("Hello World") c) alertBox="Hello World" d) alertBox("Hello World") - Answer-a) alert("Hello World") 7. How do you create a function? a) function:myFunction() b) function=myFunction() c) function myFunction() d) myFunction():function - Answer-c) function myFunction() 8. How do you call a function named "myFunction"? a) call myFunction() b) myFunction() c) call function myFunction d) CFunction() - Answer-b) myFunction() 9. How do you write a conditional statement for executing some s
Document information
- Uploaded on
- May 23, 2024
- Number of pages
- 7
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers