Harsh Ajmire Css 9-12
Harsh Ajmire Css 9-12
Alm: Develop a webpage for validation of form fields using regular expressions.
Regular expressions are an important notation for defining patterns. Each pattern connects a set
of strings. Therefore regular expressions will give as names for sets of strings.
It supports an appropriate and useful notation for describing tokens. Regular Expressions define
the language accepted by finite Automata (Transition Diagram).
Program:-
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
func on checkEmail()
if (!res)
else
{
alert("You entered a correct email address.");
</script>
</head>
<body>
</form>
</body>
</html>
Output:-
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, ini al-scale=1.0">
< tle>Simple Subtrac on in JavaScript</ tle>
<style>
</style>
</head>
<body>
<div class="container">
<h2>Subtrac on Calculator</h2>
<p>Enter two numbers to subtract:</p>
<label for="num1">Number 1:</label>
<input type="number" id="num1" placeholder="Enter first number">
if (isNaN(num1) || isNaN(num2)) {
document.getElementById("result").innerText = "Please enter valid numbers.";
} else {
Basic Concept:-
Displaying banners ads is a common practice for showing advertisements on web pages
to the visitors. Banners ads are normally created using standard graphic tools such as
Photoshop, Paintbrush Pro, and other software. Banner ads can be static or animated.
Animated images are animated GIF files or flash movies. Flash movies are created
using Macromedia Flash and the browsers must have installed flash plugin to view the
movies. On the other hand, you can create some animated effect using JavaScript, like
rotating static banner ads at a certain time interval.
Program:-
<!DOCTYPE html>
<html>
<head>
<title>Banner</title>
</head>
<body>
<center>
<a href="https://csinfohub.blogspot.com/">
<img src="https://example.com/path-to-your-image/C-
P_QuizSpot_banner4.jpeg" height="200" width="400">
</a>
</center>
</body>
</html>
Output:-
Aim:- Write simple javascript with HTML for arithma c expression evalua on
and message prin ng.
Program:-
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, ini al-scale=1.0">
< tle>Arithme c Expression Evalua on</ tle>
<script>
func on evaluateExpression() {
let expression = document.getElementById("expression").value;
try {
let result = eval(expression);
document.getElementById("result").innerHTML = "Result: " + result;
} catch (error) {
document.getElementById("result").innerHTML = "Invalid Expression!";
}
}
</script>
</head>
<body>
<h2>Arithme c Expression Evalua on</h2>
<label for="expression">Enter an arithme c expression:</label><br>
<input type="text" id="expression" placeholder="e.g., 3+5*2"><br><br>
<bu on onclick="evaluateExpression()">Evaluate</bu on>
<p id="result"></p>
</body>
</html>
Output:-