Assignment
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Assignment</title>
<link rel="stylesheet" href="Assignment.css">
</head>
<body>
<div>
<p>
This is a demo of mouse events as a paragraph
:sdagrfsedzrtfrtfrtfrtfrtfrtfgbdhdhdhdhdhdhfnmhjfdgxhfbvtywwwwjmkhfddtjjjjfhdhedtyujhyr
</p></div>
<input type="text" />
<script src="Assignment.js"></script>
</body>
</html>
CSS
p{
width: 200px;
height: 500px;
border: 1px solid black;
display: flex;
justify-content: center;
overflow: scroll;}
JS
let inp = document.querySelector("input");
inp.addEventListener("mouseout", function () {
console.log("Mouse moved");
});
inp.addEventListener("keypress", function () {
console.log("Key Pressed");
console.log(this.value);
});
let p = document.querySelector("p");
p.addEventListener("scroll", function () {
console.log("scrolled...");
});
window.addEventListener("load",function(){
console.log("window loaded");
})




Comments
Post a Comment