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

Day 1 JavaScript Basics #34

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Day 1 JavaScript</title>
<script>
function trigger(){
alert("Calling Alert Fun using Internal Script")
}
</script>
</head>
<body>

<div id="div1">Text</div>
<br>
<button onclick="document.getElementById('div1').innerHTML = 'Calling inline js';">Click</button>
<br>
<p></p>
<div>
<button onclick="trigger()">Alert Window</button>
</div>
<br>

<div>
<button id="content3" onclick="LogConsole()">Console Log</button>
</div>
<br>

<div>
<button id="content3" onclick="DoPrint()">Print Page</button>
</div>
<br>

<div>
<button id="content3" onclick="DocumentWrite()">Document Write</button>
</div>
<br>

<script src="./script.js"></script>

</body>
</html>


14 changes: 14 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function LogConsole(){
console.log("Calling console log using External Script");
}

function DoPrint(){
print();
}

function DocumentWrite(){
document.write("<p>Adding extra text!</p>");
}



3 changes: 3 additions & 0 deletions tasks.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1.create a basic html page, write an inline script, internal script, import 1 external javascript file,

2.use javascript display methods (innerHTML, document.write, alert(),print(),console.log()