Q. How can you prevent a default event action in JavaScript?

  • (A) event.block()
  • (B) event.preventDefault()
  • (C) event.stop()
  • (D) event.cancel()
πŸ’¬ Discuss
βœ… Correct Answer: (B) event.preventDefault()
Explanation: event.preventDefault() stops the default behavior of an event.
Explanation by: Chandani
event.preventDefault() stops the default behavior of an event.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
82
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Chandani
Publisher
πŸ“ˆ
83%
Success Rate