Explore different code snippets and copy them for your use.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Simple Page</title>
</head>
<body>
<h1>Welcome to my page!</h1>
</body>
</html>
<audio controls>
<source src="audio.mp3" type="audio/mp3">
Your browser does not support the audio tag.
</audio>
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>John</td>
<td>30</td>
</tr>
</table>
button {
background-color: #28a745;
color: white;
border-radius: 12px;
padding: 10px 20px;
}
.card {
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}
a:hover {
color: #28a745;
text-decoration: underline;
}
function toggleVisibility() {
var element = document.getElementById("toggleElement");
element.style.display = (element.style.display === "none" ? "block" : "none");
}
const numbers = [1, 2, 3, 4, 5];
const evenNumbers = numbers.filter(num => num % 2 === 0);
console.log(evenNumbers); // [2, 4]
document.addEventListener("keypress", function(event) {
console.log("Key pressed: " + event.key);
});
body {
font-family: 'Roboto', sans-serif;
background-color: #f8f9fa;
}
h1 {
color: #28a745;
}
console.log("Hello, World!");
.container {
display: flex;
justify-content: space-between;
}
.item {
width: 30%;
background-color: #28a745;
padding: 10px;
}
document.getElementById("myButton").addEventListener("click", function() {
alert("Button clicked!");
});
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name"><br>
<input type="submit" value="Submit">
</form>