Chapter 2 :- Cascading Style Sheets and Java script

Summary
1. Cascading Style Sheets or CSS allows you to specify styles for the visual elements of the website.
2.Styles specify the appearance of particular page elements on the screen.
3.Syntax of CSS :- The syntax of CSS consists of special symbols known as rules. A CSS rule has two main parts:
a selector, and one or more declarations.
4.Advantages of CSS :-
a. we can say that CSS allows us to set the format of the website without changing the underlying structure.
b.we can make changes to the website without the fear of accidently changing the data.
c.The web designer’s job is made easier as to change the style of an element he only needs to make modifications in the CSS file.
d. Using CSS makes website designing quick and efficient.
5.Disadvantages of CSS :-
a.The CSS compatibility varies with different browsers
b.the latest browser versions are more standard-compliant and the compatibility issue has reduced.
6.JavaScript :-
(a) HTML was originally used to control the appearance of web pages.
(b) HTML, were static and could not be changed after the browser rendered them.
(c) A scripting language is a simple, lightweight programming language that does not contain the advanced programming functionalities of languages like C and Java JavaScript is used in web pages to improve the design and validate the forms.
(d) The most common form of JavaScript application today is client side script which runs inside a web browser.
(e) JavaScript code runs from within the HTML web page. Thus, the JavaScript code can be put directly inside the web page code as a separate section.
7. Events :- JavaScript is useful in creating interactive web pages which responds to the action performed by the user. The interaction between the user and the web page causes the browser to generate an event.
8.Event Description
abort :- Loading of image is cancelled
blur :-  Element such as a radio button becomes inactive
click :- User clicks on a form element
change :-   Value of a form field is changed by the user
error :-  Error occurs during loading of a document or image
focus :-  Element such as button becomes active
load :-  Document or image is loaded
mouse out :-  Mouse moves off the element
mouse over :-  Mouse moves over the element
reset  :- Form fields are reset to default values
select :- User selects a form field
submit :-  User submits a form
unload :-  User leaves a page

Multiple Choice Question 

(1) Which of the following allows specifying styles for the visual elements of the website ?
(a) Cascading Style Sheets                                  (b) Webpage
(c) Form                                                                  (d) Animation

(2) Which of the following is known as special symbol in the syntax of CSS ?
(a) Rules                                                                 (b) Selector
(c) Declaration                                                      (d) Input

(3) Which of the following are two main parts of CSS rule ?
(a) Selector, declaration                                      (b) Select, declaration
(c) Selector, declare                                             (d) Selection, declaration

(4) Which of the following is an HTML element on which style can be applied ?
(a) declaration                                                       (b) selector
(c) select                                                                 (d) declare

(5) Which of the following is the syntax of CSS ?
(a) select {property : value}                                 (b) selector {value : property}
(c) selector {property : value}                            (d) selection {property : value}

(6) Which of the following has developed JavaScript ?
(a) Yahoo                                                                (b) Google
(c) Wikipedia                                                          (d) Netscape

(7) Which of the following is a scripting language that allows adding programming to web pages ?

(a) Action script                                                     (b) JavaScript
(c) HTML                                                                 (d) C$$

(8) Which of the following is a scripting language that is simple, lightweight programming language that does not contain advanced programming functionalities ?
(a) JavaScript                                                        (b) HTML
(c) C                                                                        (d) Java

(9) Which of the following tag is used to insert JavaScript code into an HTML page ?
(a) <script>… <script>                                          (b) <script>… </script>
(c) <script>… <//script>                                      (d) </script>… </script>

(10) Which of the following symbol signifies the start and end of a JavaScript block ?
(a) semicolon                                                        (b) square bracket
(c) curly bracket                                                   (d) round bracket

(11) Which of the following is a reusable block of code that performs a particular task ?

(a) Array                                                                 (b) Code
(c) Program                                                           (d) Function

(12) Which of the following statement is used to return a value in a function ?
(a) retum                                                                (b) function
(c) select                                                                 (d) send

(13) Which of the following is generated by the browser due to interaction between the user and the web page ?
(a) Function                                                            (b) Response
(c) Event                                                                  (d) Value

(14) Which of the following is not an event ?
(a) Abort                                                                  (b) Mouseover
(c) Set                                                                       (d) Load

(15) Which of the following is a container for storing data ?
(a) Variable                                                             (b) Integer
(c) Event                                                                   (d) Event handler

(16) Which of the following stands for BOM ?
(a) Browser Of Model                                            (b) Browser Object Model
(c) Browser Object Modelling                               (d) Browse Object Model

(17) Which of the following is the top level object in the browser object model ?
(a) Window                                                               (b) Document
(c) Page                                                                     (d) Location

(18) Which of the following stands for NaN ?
(a) Not a Numeric                                                  (b) Not a Number
(c) Not a Noun                                                        (d) Not an Numeric