This repository was archived by the owner on Mar 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
const button = document.getElementById("button"); | ||
const input = document.getElementById("input"); | ||
const a = document.getElementById("a"); | ||
const h1 = document.getElementById("h1"); | ||
var button = document.getElementById("button"); | ||
var input = document.getElementById("input"); | ||
var a = document.getElementById("a"); | ||
var h1 = document.getElementById("h1"); | ||
//document.addEventListener('DOMContentLoaded', () => { | ||
//document.getElementById('myLink').href = 'https://newexample.com'; | ||
const go = () =>{ | ||
let num = input.value.length; | ||
h1.textContent = "go to website" | ||
a.href = input.value; | ||
} | ||
|
||
button.addEventListener("click",go) | ||
var go = function go() { | ||
var num = input.value.length; | ||
h1.textContent = "go to ".concat(input.value); | ||
a.href = input.value; | ||
}; | ||
var clear = function clear() { | ||
h1.textContent = ""; | ||
}; | ||
button.addEventListener("click", go); | ||
a.addEventListener("click", clear); |