Chapter 2
Chapter 2
Textual Exercise:-MCQ
INTRODUCTION
Choose the most appropriate option from those given below:
What is the full form of CSS?
(A) Case Study Sheet (B) Computer Style Sheet
(C) Cascading Style Sheet (D) Computerized Spread Sheet
2. Which of the following option helps us to keep the information content of a document separate from the
details of how to display it?
(A) HTML (B) HTTP (C) Java Script (D) CSS
3. What is style?
(A) The detail of how to display the document (B) The detail of how to write the document
(C) Cascading Pattern of HTML document (D)Cascading pattern of Java script document
4. By using which option, we can set all element types to appear in a style as per our choice?
(A) Java script (B) CSS (C) Web browser (D) Web server
5. Which of the following describes the information content of the document?
(A) CSS (B) Web Server (C) HTML (D) Java Script
6. Which option describes the style of the elements in the document and not its contents?
(A) CSS (B) Web browser (C) HTML (D) Both A & C
7. Which of the following option/s of our web site is/are controlled by CSS?
(A) Font types (B) Font and element colors (C) Margins (D) All A, B & C
8. Pad spaces and element position of our website are controlled by which option?
(A) HTML (B) CSS (C) Java Script (D) Web Browser
SYNTAX OF CSS
9. In how many parts CSS rules are mainly divided?
(A) Four (B) Six (C) Two (D) Three
10. Which are the main parts of CSS rule?
(A) A Selector and one or more preference (B) A Property and one or more values
(C) A Selector and one or more declarations (D) None of these
11. Which of the following consists of a property associated with the HTML element used in selector and its
corresponding value?
(A) HTML (B) Declaration (C) Edit menu (D) <p> tag
DISADVANTAGES OF CSS
33. Which program does not support some of the style features?
(A) Panel (B) Status bar (C) Browser (D) Editor
JAVASCRIPT
34. What was the use of HTML originally?
(A) To do programming (B) To display images
(C) To design Server (D) To control the appearance of web pages
35. Which kind of web pages can be created using HTML?
(A) Dynamic (B) Static (C) Simple without formatting (D) All A, B & C
36. Which scripting language allows us to add programming aspects to our web pages?
(A) VB Script (B) C++ (C) JavaScript (D) Java
37. Which are the features of scripting language?
(A) It is simple
(B) Light weight programming language
(C) It doesn’t contain the advanced programming functionalities like C and Java
(D) All A, B & C
38. Which is used to improve the design in web pages and validate the forms?
(A) JavaScript (B) HTML (C) CSS (D) HTML Forms
39. Which can add interactivity to HTML pages?
(A) CSS (B) JavaScript (C) HTML (D) Frames
40. Which of the following can be inserted directly into the HTML code?
(A) CSS (B) VB Script (C) JavaScript (D) HTML
41. Which of the following is used to create HTML content dynamically?
(A) Web server (B) JavaScript (C) CSS (D) Web browser
42. What will restrict users from making mistakes?
(A) Web Browser (B)Validation (C) HTML Forms (D) CSS
43. Which is the most common form of JavaScript today?
(A) Client side script (B) Server side script (C) Both A & B (D) VB Script
44. Which of the following is used to validate the data entered in the HTML forms on the client side before
sending it to the server?
(A) CSS (B) HTML Forms (C) JavaScript (D) Web Browser
45. Which of the following is case sensitive language?
(A) CSS (B) HTML (C) Web Browser (D) JavaScript
46. Generally, within which tag the JavaScript code will be placed?
(A) <Body> (B) <Head> (C) <Style> (D) <Java>
47. Which tag tells the browser to interpret all the text between the <script> tag as a script?
(A) <Script> (B) <CSS> (C) <style> (D) <body>
48. In the statement,document.write(“Hello World”);”Which is the method?
(A) Hello World (B) document (C) document.write (D) write
49. In the above statement, which is object?
(A) “Hello World” (B) write (C) document (D) document.write
50. Where should we pass the string which is to be displayed?
(A) In <body> tag
(B) As variable to the method document. Write()
(C) As script to the <style> tag
(D) None of these
51. Which symbol is used as a mark of separation or termination?
(A) Colon (B) Dot (C) Comma (D) Semicolon
52. What is used to create a group of JavaScript statements?
(A) Group (B) Block (C) Function (D) Program
53. Which symbols are used to start and end a block?
(A) ( ) (B) [ ] (C) { } (D) “ ”
54. In the form, what should be kept simple and easy to remember?
(A) Block Name (B) Name given to the form (C) Input field name (D) Both B & C
55. Which button will open “Advanced Property Editor” dialog box?
(A) Advanced Edit (B) Open (C) General (D) Properties
56. A reusable block of code that performs a particular task is called…..
(A) Script (B) Function (C) Style sheet (D) Web page
57. What is another name of function?
(A) Web page (B) Program (C) Routine (D) Style sheet
58. What is defined by the keyword function?
(A) Style sheet (B) Function (C) Routine (D) Both B & C
59. Where can we write block of code?
(A) Inside the Paranthesis ( ) (B) Inside the Square brackets [ ]
(C) Inside the curly braces { } (D) Within double quotes”
60. Which of the following is inbuilt function of JavaScript?
(A) ValidateForm( ) (B) alert( ) (C) Check ( ) (D) Draw( )
61. Which function takes the text and displays it in an alert box?
(A) Alert( ) (B) write( ) (C) display( ) (D) show( )
62. How can we execute the function?
(A) By an event (B) Call it inside a source code
(C) By clicking on it (D) Both A & B
63. Where can we define function?
(A) In Head section (B) In Body section (C) Both A & B (D) In CSS section
64. How can we call function?
(A) By its value (B) By Body tag (C) By its name (D) None of these
65. By using which statement, it is possible to return function value?
(A) Document.write( ) (B) Return (C) Showvalue( ) (D) Display( )
EVENTS
(66).Which kind of web pages can be created using JavaScript?
(A) Static (B) Unformatted (C) Simple Text based (D) Interactive
(67).What will be generated by browser, when the interaction between the user and the web page occur?
(A) Action (B) Method (C) Event (D) Interaction
(68).What will take place when user does something?
(A) Downloading (B) Uploading (C) Both A & B (D) Event
(69).Which event would occur when loading of image is cancelled?
(A) Abort (B) Error (C) Load (D) Reset
(70).With which event, elements such as radio button becomes inactive?
(A) Change (B) Blur (C) Unload (D) Select
(71).Which event would occur when user clicks on a form element?
(A) Focus (B) Change (C) Click (D) Reset
(72).Which event would occur when value of a form field is changed by the user?
(A) MouseOut (B) Load (C) Reset (D) Change
(73)Which event would occur when error occurs during loading of a document or image?
(A) Error (B) Submit (C) Mouseover (D) Unload
(74).Which event would occur when element such as button becomes active?
(A) Abort (B) Blur (C) Select (D) Focus
(75).Which event would occur when document or image is loaded?
(A) Focus (B)Reset (C) Load (D) Unload
(76).Which event would occur when we move mouse off the element?
(A) Change (B) MouseOut (C) Mouseover (D) Click
(77).Which event would occur when we move mouse over the element?
(A) Change (B) Load (C) Reset (D) Mouseover
(78)With which event, form fields are reset to default values?
(A) Change (B) Select (C) Reset (D) Error
(79)Which event would occur when user selects a form field?
(A) Submit (B) Select (C) Change (D) Load
(80)Which event would occur when user submits a form?
(A) Submit (B) Reset (C) Both A & B (D) Load
(81)Which event would occur when user leaves a page?
(A) Blur (B) Error (C) Unload (D) Reset
(82)What is the name of JavaScript code which is executed in response to a given situation, when event
occurs?
(A) Validation (B) Event handler (C) Function (D) Event
(83)Which names are kept same as the name of the event?
(A) Function (B) File (C) Script (D) Event handler
VARIABLES
(84)Which type of data can be stored in the variables?
(A) Numbers (B) Strings (C) Text (D) All A, B & C
(85)With which keyword we can declare a variable?
(A) Var (B) Script (C) CSS (D) HTML
IF STATEMENT
isNaN( )
(100)Which built-in function of JavaScript is commonly used to work with numeric values?
(A) Number( ) (B) isNumber( ) (C) isString( ) (D) isNaN( )
(101)What will be the output of isNaN(123)?
(A) Error message (B) No output (C) 123 (D) False
(102)What will be the output of isNaN(“hello”)?
(A) Hello (B) True (C) Error message (D) No output
(103)Which of the following is a scripting language that allow us to add logical aspects to our web pages?
(A) JavaScript (B) VB Script (C) HTML (D) Event