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>

New & Trending Tutorials

Docker

Docker Images

Learn about Docker images, their purpose, and how to create, manage, and use them efficiently in containerized applications.

Docker

Docker Installation

Learn how to install Docker on Windows, macOS, and Linux. Follow step-by-step instructions to set up Docker and verify its installation on your system.

Docker

Introduction to Docker

Learn what Docker is and why it is essential for modern application deployment. Understand the basics of containerization and how Docker simplifies software development.

GIT

Git Resolve Merge Conflicts

Learn how to resolve merge conflicts in Git with simple steps. Understand why conflicts happen and how to fix them using Git commands and best practices.

GIT

Git Lifecycle

Learn about the Git lifecycle, including working directory, staging area, local repository, and remote repository. Understand how changes move through these stages for efficient version control.

GIT

Git Basic Commands

Learn the essential Git commands for version control. This tutorial covers initializing a repository, staging, committing, branching, merging, and pushing changes.

GIT

Git Setup

Learn how to set up Git after installation. Configure Git with your name and email, set up SSH keys for authentication, and initialize a repository for version control.

GIT

Git Installation

Learn how to install Git on Windows, macOS, and Linux with this step-by-step guide. Set up Git and start managing your code efficiently.

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.