Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jihongeek committed Aug 6, 2024
2 parents 417c75c + cf49f04 commit 20e919e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
20 changes: 8 additions & 12 deletions yoojin/노마드/app.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
const title = document.querySelector("div.hello:first-child h1");
const loginInput = document.querySelector("#login-form input");
const loginButton = document.querySelector("#login-form button");

function handleTitleClick() {
title.style.color = "blue";
function onLoginBtnClick() {
console.log("hello", loginInput.value);
}

function handleMouseEnter() {
title.innerText = "Mouse is here!";
if (loginButton) {
loginButton.addEventListener("click", onLoginBtnClick);
} else {
console.error("loginButton이 존재하지 않습니다.");
}

function handleMouseLeave() {
title.innerText = "Mouse is gone!";
}
title.addEventListener("click", handleTitleClick);
title.addEventListener("mouseenter", handleMouseEnter);
title.addEventListener("mouseleave", handleMouseLeave);
5 changes: 3 additions & 2 deletions yoojin/노마드/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
<title>Momentum App</title>
</head>
<body>
<div class="hello">
<h1>Click me!</h1>
<div id="login-form">
<input type="text" placeholder="What is your name?" />
<button>Log In</button>
</div>
<script src="app.js"></script>
</body>
Expand Down
Empty file added yoojin/노마드/style.css
Empty file.

0 comments on commit 20e919e

Please sign in to comment.