السبت، 13 يونيو 2015

MCQ on Scripting Documents in Client Side JavaScript set-7

1) .......... method of the window object takes the X and Y coordinates of a point in document coordinates and sets these as the scroll bar offsets.

A. scrollTo()

B. scrollLeft()

C. scrollTop()

D. scrollFor()


2) We can compute the position of the element with ..........., converts that position to document coordinates and then use the scrollTo() method.

A. getBoundingClient()

B. getBounding()

C. getBoundingClientRect()

D. getBoundingRect()


3) The read-only .......... properties of any HTML element return its on screen size, in CSS pixels.

A. offsetWidth()

B. offsetHeight()

C. Both A and B

D. None of the above


4) ......... are like offesetWidth and offesetHeight except that they do not include the border size, only content area and its padding.

A. offesetLeft and offesetTop

B. clientWidth and clientHeight

C. clientLeft and clientTop

D. scrollWidth and scrollHeight


5) ............. properties return the horizontal and vertical distance between the outside of an element's padding and the outside of its border.

A. offesetLeft and offesetTop

B. clientWidth and clientHeight

C. clientLeft and clientTop

D. scrollWidth and scrollHeight



6) ........... are the size of an element's content area plus its padding plus any overflowing content.

A. offesetLeft and offesetTop

B. clientWidth and clientHeight

C. clientLeft and clientTop

D. scrollWidth and scrollHeight


7) Which of the following expressions in JavaScript is/are True, if we have to select a form name "address" has a first element with name "street".

A. document.forms.address[0]

B. document.forms.address.street

C. document.address.street

D. All of the above


8) Which of the following is/are the valid expressions, if we have to select a <form> with a name="address" attribute.

i) window.address

ii) document.address

iii) document.forms.address

iv) document.forms[n]

A. i, ii and iii only

B. ii, iii and iv only

C. i, ii and iv only

D. All i, ii, iii and iv


9) .......... method returns a selection object that describes the current selection as a sequence of one or more range objects.

A. window.objectSelection()

B. window.getSelection()

C. document.getSelection()

D. document.currentSelection()


10) State whether the following statements are True or False for the document.write() method in client side JavaScript.

i) The document.write() method was one of the very first scriptable APIs implemented by Netscape2 web browser.

ii) document.write() concatenates its string arguments and inserts the resulting string into the document at the location of the script element that invoked it.

iii) The document.write() method is commonly used in modern code i.e. innerHTML property and other DOM techniques.

A. i-True, ii-True, iii-False

B. i-True, ii-False, iii-False

C. i-True, ii-True, iii-True

D. i-False, ii-False, iii-True



11) When a document contains scrollable elements with overflowing content, the ............ method doesn't work correctly because it does not take scroll bar position into account.

A. getElementPosition()

B. getScrollPosition()

C. getScrollOffsets()

D. getBoundingClientRect()


12) .......... method is used in the case of passing the coordinates of the mouse pointer to determine which element the mouse is over.

A. getBoundingClientRect()

B. getElementFromPoint()

C. elementFromPoint()

D. getElementCoordinates()


13) The .......... method of the window is similar to scroll() and scrollTo(), but its arguments are relative and are added to the current scroll bar offsets.

A. scrollTop()

B. scrollBy()

C. scrollLeft()

D. scrollIntoView()


14) The ......... method ensures that the element on which it is invoked is visible in the view-port.

A. scrollTop()

B. scrollBy()

C. scrollLeft()

D. scrollIntoView()


15) The .......... property specifies which element the properties are relative to and if it is null, the properties are document object.

A. offsetLeft

B. offsetTop

C. offsetParent

D. offsetRelative


Answers:


1) A. scrollTo()
2) C. getBoundingClientRect()
3) C. Both A and B
4) B. clientWidth and clientHeight
5) C. clientLeft and clientTop
6) D. scrollWidth and scrollHeight
7) D. All of the above
8) D. All i, ii, iii and iv
9) B. window.getSelection()
10) A. i-True, ii-True, iii-False
11) A. getElementPosition()
12) C. elementFromPoint()
13) B. scrollBy()
14) D. scrollIntoView()
15) C. offsetParent


Related Posts:

For more Multiple Choice Questions (MCQs): Click Here

ليست هناك تعليقات:

إرسال تعليق