Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i cant build logic for javascript part 10 assignment #142

Open
shubhu10 opened this issue Mar 31, 2024 · 0 comments
Open

i cant build logic for javascript part 10 assignment #142

shubhu10 opened this issue Mar 31, 2024 · 0 comments

Comments

@shubhu10
Copy link

p.addEventListener("mouseout",changecolor);
h1.addEventListener("keypress",changecolor);
h3.addEventListener("scroll",changecolor);
btn.addEventListener("load",changecolor);

let inp=document.querySelector("#user");
let form=document.querySelector("form");
let display=document.querySelector(".h1");

let formBtn=document.querySelector(".btn");
form.addEventListener("submit",function(event){
event.preventDefault();
})

inp.addEventListener("input",function(event)
{ event.preventDefault();

let value=inp.value;
console.log(event.keyCode);
console.log(event.key);
console.dir(value);

if((inp.keyCode<90 && inp.keyCode>65) || inp.keyCode==32 )
{
  
  display.innerHTML=value;
}

});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant