Skip to content

Instantly share code, notes, and snippets.

View programmerrush's full-sized avatar

Programmer Rushikesh programmerrush

View GitHub Profile
<html>
<head>
<title>My Page</title>
</head>
<body>
<h1>Welcome to my page</h1>
<p>This is some text on my page</p>
</body>
</html>
<script><![CDATA[
function showMessage() {
alert("Hello World!");
}
]]></script>
function Car(make, model, year) {
this.make = make;
this.model = model;
this.year = year;
this.drive = function() {
console.log(`Driving my ${this.year} ${this.make} ${this.model}`);
};
}
const myCar = new Car('Toyota', 'Camry', 2019);
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My XHTML Page</title>
</head>
<body>
<h1>Welcome to my XHTML Page</h1>
<p>This is a simple example of an XHTML page.</p>
<label>Quantity: <input type="number" id="quantity" onchange="updateTotal()"></label>
<label>Price: $<span id="price">10</span></label>
<label>Total: $<span id="total"></span></label>
<script>
function updateTotal() {
var quantity = document.getElementById("quantity").value;
var price = document.getElementById("price").innerHTML;
var total = quantity * price;
document.getElementById("total").innerHTML = total;
<form action="submitform.php" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name" />
<br />
<label for="email">Email:</label>
<input type="text" id="email" name="email" />
<br />
<label for="gender">Gender:</label>
<input type="radio" id="male" name="gender" value="male" checked />
<label for="male">Male</label>
<!DOCTYPE myDoc SYSTEM "myDoc.dtd">
<img src="image.jpg" alt="A beautiful landscape of a mountain range">
<h1 style="color: red;">This is a heading</h1>
<!DOCTYPE html>
<html>
<head>
<title>Stylesheet Examples</title>
<!-- External Stylesheet -->
<link rel="stylesheet" href="styles.css" type="text/css" />
<!-- Internal Stylesheet -->
<style>