Ch 1 Web Design ยท Ch 2 SEO ยท Ch 3 JavaScript ยท Ch 4 Emerging Tech ยท Ch 5 PHP ยท Ch 6 E-Commerce
๐ฅ = Sure Shot | โญ = Very Important | ๐ = Important
style attribute. e.g. <p style="color:red;"><style> tag in the <head> section.<link rel="stylesheet" href="style.css">p { color: blue; }#header { font-size: 20px; }.box { border: 1px solid; }* { margin: 0; }h1, h2, p { font-family: Arial; }@media (max-width: 600px) { body { font-size: 14px; } }
<meta name="viewport" content="width=device-width"><header> โ Page or section header<nav> โ Navigation links<main> โ Main content of page<section> โ A section of content<article> โ Independent content like blog post<footer> โ Page footer<aside> โ Sidebar content<head> section that provide information about the webpage to search engines and browsers.<meta name="description" content="..."> โ Page description shown in search results<meta name="keywords" content="..."> โ Keywords for search engines<meta name="robots" content="index, follow"> โ Controls indexing<meta name="viewport" content="width=device-width"> โ For mobile responsivenessonclick="alert('Hello')"document.getElementById("id") โ Select element by IDdocument.getElementsByClassName("class") โ Select by classdocument.querySelector("selector") โ Select first matching elementelement.innerHTML = "text" โ Change HTML contentelement.style.color = "red" โ Change CSSelement.setAttribute("attr","val") โ Change attributefunction validate() {
var name = document.getElementById("name").value;
if(name == "") {
alert("Name is required!");
return false;
}
}var fruits = ["Apple", "Mango", "Banana"];push() โ Add element at endpop() โ Remove last elementshift() โ Remove first elementunshift() โ Add element at beginninglength โ Returns number of elementssort() โ Sort array elementsreverse() โ Reverse the arraysplice() โ Add/remove elements at specific indexdocument.cookie = "username=Rahul; expires=Thu, 01 Jan 2026 00:00:00 UTC";var c = document.cookie; // returns all cookies as stringdocument.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; (set past date)<?php
echo "Hello World!";
?>$ sign. e.g. $name = "Rahul"; $age = 20;$name = "Hello";$age = 20;$price = 9.99;$flag = true;$arr = array(1,2,3);$val = NULL;mysqli_connect()$conn = mysqli_connect("localhost","root","","mydb");
$sql = "SELECT * FROM students";
$result = mysqli_query($conn, $sql);
while($row = mysqli_fetch_array($result)) {
echo $row['name'];
}
mysqli_close($conn);
function functionName($parameter) {
// code
return value;
}
function add($a, $b) {
return $a + $b;
}
echo add(5, 3); // Output: 8