<!DOCTYPE html>
<html lang="en">
<head>
<!-- CSS LINK -->
<link rel="stylesheet" href="./PATH_TO_CSS_FILE">
<!-- JS LINK -->
<script src="./PATH_TO_JS_FILE"></script>
<title>Super Sweet Website</title>
</head>
<body>
<!-- HTML GOES HERE -->
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- CSS LINK -->
<link rel="stylesheet" href="./PATH_TO_CSS_FILE">
<title>Super Sweet Website</title>
</head>
<body>
<!-- HTML GOES HERE -->
</body>
<!-- JS LINK -->
<script src="./PATH_TO_JS_FILE"></script>
</html>
const submitBtn = document.getElementById('submit')
const box = document.getElementById('box')
box.innerText = 'Hello, world'
<body>
<button onclick="someFunction()">
Click me to run Javascript!
</button>
</body>
const container =
document.getElementsByClassName('container')
NOTE: Always returns an array-like list, even if there's only one item
const box = document.getElementById('box')
box.style.background = "#bada55"
//^^sets the background color^^//
const buttons = document.getElementsByTagName('button')
const box = document.getElementById('box')
box.className // box
box.className = 'square'
box.className // square
const box = document.getElementById('box')
box.classList // box
box.classList.add('square')
box.classList // box, square
box.classList.remove('square')
box.classList // box
const box = document.getElementById('box')
box.innerHTML = <p> + 'Hello, world' + </p>
const userInput = document.getElementById('input')
const userInputValue = userInput.value
userInputValue = 'yo dude'
const clickFn = () => {
console.log('some stuff')
}
const box = document.getElementById('box')
box.addEventListener('click', clickFn)
<body>
<div onclick='firstFn()'>
<div onclick='secondFn()'>
<div onclick='thirdFn()'>
Click me!
</div>
</div>
</div>
</body>
const thirdFn = (event) => {
console.log('do a thing, then stop')
event.stopPropagation()
}
const box = document.querySelector('#box')
const box2 = document.querySelector('.box')
const box3 = document.querySelector('div')
const allBoxes = document.querySelectorAll('.box')
const allDivs = document.querySelectorAll('div')
const mainContent = document.querySelector('#main')
const newParagraph = document.createElement('p')
newParagraph.innerText = `I'm a new paragraph`
mainContent.append(newParagraph)
const mainParagraph = document.querySelector('#main>p')
mainParagraph.remove()
const img = document.querySelector('img')
const newUrl = 'http://your-img.jpg'
const imgUrl = img.getAttribute('src')
//^^ gets the url in the src. ^^//
img.setAttribute('src', newUrl)
//^^ changes the src atribute. ^^//