Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

button click

const thing = document.querySelector("#get-residents")


const cons = () => {
    console.log('click')
}

thing.addEventListener('click', cons)

/* this is what the query selector needs to operate 
    <button id="get-residents">get residents</button>
    
    <script src="main.js"></script>
    <script src="./node_modules/axios/dist/axios.min.js"></script>
*/
 
PREVIOUS NEXT
Tagged: #button #click
ADD COMMENT
Topic
Name
3+4 =