Professional Documents
Culture Documents
Ans 2
Ans 2
Copilot
Certainly! Let’s dive into the development of static and dynamic websites using HTML and JavaScript, with
practical examples:
2. Technologies Involved:
JavaScript:
Enhances interactivity (e.g., image sliders, form validation).
Example (showing an alert):
<script>
alert("Welcome to my website!");
</script>
3. Hosting:
Host your static files on a web server or platforms like GitHub Pages.
Example: Upload your HTML, CSS, and JS files to GitHub and enable GitHub Pages.
2. Technologies Involved:
Front-End (Client-Side):
HTML/CSS for layout.
JavaScript for interactivity.
Example (HTML):
<ul id="todo-list"></ul>
<input type="text" id="task-input" placeholder="Add a task">
<button onclick="addTask()">Add Task</button>
Example (JavaScript):
function addTask() {
const taskInput = document.getElementById("task-input");
const taskList = document.getElementById("todo-list");
const newTask = document.createElement("li");
newTask.innerText = taskInput.value;
taskList.appendChild(newTask);
taskInput.value = "";
}
Back-End (Server-Side):
Set up a server (e.g., Node.js with Express).
Connect to a database (e.g., MongoDB).
Example (Node.js):
const express = require("express");
const app = express();
app.listen(3000, () => {
console.log("Server running on port 3000");
});
Remember, these examples provide a glimpse into the world of web development. Keep practicing and
exploring to build more complex and exciting websites! 🚀