Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function focused() {
- let inputArray = Array.from(document.querySelectorAll("input"))
- for (const input of inputArray) {
- input.addEventListener("click", clickHandler)
- input.addEventListener("blur", blurHandler)
- }
- function clickHandler(e){
- let input = e.currentTarget
- let divParent = input.parentElement
- divParent.className = "focused"
- }
- function blurHandler(e){
- let input = e.currentTarget
- let divParent = input.parentElement
- divParent.className = ""
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement