Skip to content

IftekherAziz/JavaScript-Events

Repository files navigation

1.What is an event on a website?

  • All of the avove

2.Which one is not a keyboard event?

  • keyhug

3.How will you add the purchaseProduct function for clicking on the button?

  • Purchase Now

4.How will you add a click handler? document.getElementById(‘order’)_____?____(‘click’, function(){ })

  • .addEventListener
  1. What is a callback function in javascript?
  • A callback function is a function that is passed as an argument to another function
  1. What is the event bubble?
  • The event bubble is the process of an event being triggered on an element and then bubbling up to its parent element
  1. How can you access the inner content of a text input field?
  • Value ( document.getElementById(‘text-field’).value )
  1. Select the first element with the selector statement : ( main .title .t1 )
  • document.querySelector(‘main .title .t1’)
  1. How to select the parent element of an element?
  • parentNode()
  1. How will you get text inside an input tag? event.? ;
  • target.value