W3schools Tutorials & Courses

Learn programming for free with our latest online learning resources with simple examples.

Learn How to Code

<!DOCTYPE html>
<html>
  <head>
    <title>Webpage Title</title>
  </head>
  <body>
    <h1>Main Heading</h1>
    <p>A paragraph text.</p>
  </body>
</html>
body {
  background-color: #FFF; 
  font-size: 16px;
}
h1 {
  font-size: 2rem;
}
p {
  font-family: Verdana,sans-serif;
}
<button onclick="demoFunc()">Click Me!</button>
<script>
  function demoFunc() {
    let p = document.getElementById("p");
    p.textContent = "You changed this text!";
    p.style.fontSize = "20px";
    p.style.color = "blue";
  }
</script>

Express.js

Web Framework

Learn to build fast and scalable server-side applications with Node.js.

const express = require('express');
const app = express();

app.get('/', (req, res) => {
  res.send('Hello Express.js!');
});

app.listen(3000, () => {
  console.log('Server running on port 3000');
});
<?php
echo "Hello, I'm a PHP script!";
function demoFunc()
{
  echo "It works.";
  echo "Today's date is " . date('Y-m-d');
  echo "Have a great day!";
}
demoFunc();
?>
-- Retrieve active users
SELECT userID, 
       CONCAT(firstName, ' ', lastName) AS name, 
       email,
       registrationDate
FROM users
WHERE status = 1;
-- End of query
-- Output: userID, name, email, registrationDate
def greet():
  return '''Welcome to Python!
It's easy to learn.'''

message = greet()
print(message)

Java

Programming Language

Learn to create cross-platform applications and enterprise software.

public class Greet {
  static String greet() {
    return "Welcome to Java!";
  }

  public static void main(String[] args) {
    System.out.println(greet());
    System.out.println("It's easy to learn.");
  }
}

JSP

Web Technology

Learn to build dynamic web content with Java integration.

<%@ page contentType="text/html; charset=UTF-8"%>
<html>
<head>
  <title>Quick JSP Demo</title>
</head>
<body>
  <p>Hello, I'm a JSP script!</p>
  <% out.println("Today's date is " + new java.util.Date()); %>
</body>
</html>
#include<stdio.h>

int main()
{
  printf("First C Program.\n");
  return 0;
}

C++

Programming Language

Learn to create systems software with object-oriented capabilities.

#include <iostream> 

int main()
{
 std::cout<<"First C++ Program.";
 std::cout<<std::endl<<"Its easy to learn.";
}

JSON & XML

Data Interchange Formats

Learn to structure and exchange data efficiently with JSON and XML.

{
  "user": {
    "name": "User name",
    "active": true
  }
<user>
  <name>User name</name>
  <active>true</active>
</user>

Latest, Popular Tutorials

Express.js

Express.js JWT Authentication with MongoDB

Learn how to implement JWT authentication in an Express.js application using MongoDB, Mongoose, bcryptjs, and jsonwebtoken. This tutorial walks you through user authentication with hashed passwords and token-based access control.

HTML5

HTML <input> Pattern Attribute

Learn how to use the HTML <input> pattern attribute to validate user input with regular expressions. Enhance form validation and user experience with custom patterns.

Express.js

Express.js Environment Variables

Learn how to use environment variables in Express.js to manage configuration settings securely. Explore the .env file, process.env, and best practices for handling sensitive data.

Express.js

Express.js Templating with Pug

Learn to integrate Pug with Express.js for dynamic server-side HTML. This guide covers setup, templates, data passing, and reusable partials for efficient content rendering

PHP 8

PHP 8.0 fdiv Function

Learn how to use PHP 8.0's fdiv function for safe division, handling division by zero gracefully with INF, -INF, and NAN outputs. Perfect for error-free calculations.

PHP 8

PHP 8.0 Mixed Type

Explore PHP 8.0's mixed type—a flexible union type allowing variables, parameters, or return types to accept multiple data types. Learn syntax, examples, limitations, and best practices for using mixed types in PHP functions to enhance flexibility and readability.

PHP 8

PHP 8.1 New Initializers

Learn how to use PHP 8.1's new initializers to set up class properties with arrays, objects, and constants. Create cleaner, more efficient object-oriented code.