Move js out of html

This commit is contained in:
Imbus 2023-11-01 10:58:12 +01:00
parent 05050e07ea
commit 097a8db09c
2 changed files with 7 additions and 8 deletions

View file

@ -1,12 +1,5 @@
<html> <html>
<script> <script src="script.js"></script>
function expand() { document.getElementById("bar").style.height = "100%"; }
function collapse() { document.getElementById("bar").style.height = "0px"; }
function myFunction() {
if (document.getElementById('bar').clientHeight == 0) { expand(); }
else { collapse(); }
}
</script>
<LINK href="style.css" rel="stylesheet" type="text/css"> <LINK href="style.css" rel="stylesheet" type="text/css">
<title>TC Automotives</title> <title>TC Automotives</title>

6
script.js Normal file
View file

@ -0,0 +1,6 @@
function expand() { document.getElementById("bar").style.height = "100%"; }
function collapse() { document.getElementById("bar").style.height = "0px"; }
function myFunction() {
if (document.getElementById('bar').clientHeight == 0) { expand(); }
else { collapse(); }
}