Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

what is the syntax of putting an event listener in javascript mdn

document.querySelector('#check').addEventListener('click',check)

function check() {

    const day = document.querrySelector('#day').value
  //conditional go here 
  if(day === "Tuesday" || day === "Thursday" ){
   alert('CLASS DAY!')
  }else if(day === "Saturay" || day === "Sunday"){
   alart('weekend')
  }else{
   alert('BORRRRRINNNNNNGGGGGG!!!')
  }

}

Comment

PREVIOUS NEXT
Code Example
Javascript :: enum jpa jsf jakarta9 
Javascript :: how to used xpath snapshot in loop 
Javascript :: Use Prototype To Add A Property To Javascript Class 
Javascript :: js replay animation 
Javascript :: check if value is a string javascript 
Javascript :: how to put multiple conditions in if statement node .js 
Javascript :: change firebase email on login 
Javascript :: javascript check item is checkbox 
Javascript :: js promise example 
Javascript :: javascript trunc 
Javascript :: 404 responses in express 
Javascript :: regex and 
Javascript :: string charat 
Javascript :: how to add dropdown with filter in angular material 
Javascript :: vue js laravel tutorial 
Javascript :: nodejs 
Javascript :: why we import react from react 
Javascript :: js array split 
Javascript :: convert string to integer: 
Javascript :: how to convert json to object 
Javascript :: why we use $ in jquery 
Javascript :: print a number with commas as thousands separator 
Javascript :: destroy method 
Javascript :: toggle div javascript 
Javascript :: javaScript Math.log() Method 
Javascript :: javascript casting objects 
Javascript :: id in class selector jquery 
Javascript :: angular tooltip text ngif 
Javascript :: javascript sucks 
Javascript :: how to count click events javascript 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =