HTML Multiple Choice Questions & Answers on Drag and Drop for Freshers

1. Which event is fired as the mouse is moving over an element when a drag is occurring?

a) dragover
b) dragenter
c) dragstart
d) dragleave
Answer: a

Explanation: This event is fired as the mouse is moving over an element when a drag is occurring. Much of the time, the operation that occurs during a listener will be the same as the dragenter event.
2. The _________ event is fired on the element where the drop occurred at the end of the drag operation.

a) drag
b) drop
c) dragstart
d) dragenter
Answer: b

Explanation: The drop event is fired on the element where the drop occurred at the end of the drag operation. A listener would be responsible for retrieving the data being dragged and inserting it at the drop location.
3. Which of the following property is common in all drag events?

a) drag effects
b) drag data
c) dataTransfer
d) dragenter
Answer: c

Explanation: The dataTransfer property of all drag events holds data about the drag and drop operation.
4. _____________ in textboxes and selections on web pages is done automatically, so you do not need to handle dragging yourself.

a) Dragging HTML and XML
b) Dragging Text
c) Dragging Files
d) Dragging Links
Answer: b

Explanation: Although the process is automatic, it is recommended that you always add data of the text/plain type as a fallback for applications or drop targets that do not support other types, unless there is no logical text alternative. Always add the plain text type last as it is the least specific.
5. Calling the ______________ method during both a dragenter and dragover event will indicate that a drop is allowed at that location.

a) drop
b) drag
c) preventDefault
d) dataTransfer
Answer: c

Explanation: Calling the preventDefault method during both a dragenter and dragover event will indicate that a drop is allowed at that location. However, you will commonly wish to call the preventDefault method only in certain situations, for example, only if a link is being dragged.
6. Which of the following property is used to determine which drag operation was desired?

a) dragend
b) getData
c) dropEffect
d) captureData
Answer: c

Explanation: During the drop event, you should retrieve that data that was dropped from the event and insert it at the drop location. One can use the dropEffect property to determine which drag operation was desired.
7.______________ should include data of two types; the first should be the URL using the type text/uri-list, and the second is the URL using the text/plain type.

a) Dragging HTML and XML
b) Dragging Text
c) Dragging Files
d) Dragging Links
Answer: d
8. A listener for the dragenter and dragover events are used to indicate valid drop targets, that is, places where dragged items may be dropped.

a) True
b) False
Answer: a
9. _____________ and elements in a document may be dragged using the application/x-moz-node type.

a) Dragging HTML and XML
b) Dragging Text
c) Dragging Nodes
d) None of the mentioned
Answer: c

Related

C# Questions & Answers on Abstract Class & Methods for Freshers

1. A type of class which does not have its own objects but acts as a base class for its subclass is known as? a) Static classb) Sealed classc) Abstract classd) None of the mentioned Answer: c 2. ...

C# Questions & Answers on Constructor Overloading for Freshers

1. What will be the output of the given set of code? class maths { public int length; public int breadth; public maths(int x, int y) { length = x; ...

C# Questions & Answers on Method Overriding for Freshers

1. Which keyword is used to declare a base class method while performing overidding of base class methods? a) thisb) virtualc) overrided) extend Answer: b 2. The process of defining a method in s...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item