Il 0% ha trovato utile questo documento (0 voti)
2 visualizzazioni10 pagine

Harsh Ajmire Css 9-12

Ccs practicals

Caricato da

Soham Bijwar
Copyright
© © All Rights Reserved
Per noi i diritti sui contenuti sono una cosa seria. Se sospetti che questo contenuto sia tuo, rivendicalo qui.
Formati disponibili
Scarica in formato PDF, TXT o leggi online su Scribd
Il 0% ha trovato utile questo documento (0 voti)
2 visualizzazioni10 pagine

Harsh Ajmire Css 9-12

Ccs practicals

Caricato da

Soham Bijwar
Copyright
© © All Rights Reserved
Per noi i diritti sui contenuti sono una cosa seria. Se sospetti che questo contenuto sia tuo, rivendicalo qui.
Formati disponibili
Scarica in formato PDF, TXT o leggi online su Scribd
Sei sulla pagina 1/ 10

PRACTICAL NO.

Alm: Develop a webpage for validation of form fields using regular expressions.

What is regular Expression?

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).

Regular Expressions are defined over an alphabetΣ


if R is a Regular Expression, therefore L(R) represents language denoted by the regular expression.

Program:-

<!DOCTYPE html>

<html>

<head>

<script type="text/javascript">

func on checkEmail()

var email = document.getElementById('email').value;

var regex = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/;

var res = regex.test(email);

if (!res)

alert("Please enter a valid email address.");

else

{
alert("You entered a correct email address.");

</script>

</head>

<body>

<form name="myform" ac on="#" method="post">

Enter Email ID: <input type="text" id="email" /><br />

<input type="bu on" value="Submit" onclick="checkEmail()" />

</form>

</body>

</html>

Output:-

Marks Obtained Dated signature of


Teacher
Process Related(15) Product Related(10) Total(25)
PRACTICAL NO. 10

Aim:-Develop a webpage for implementa on Minus.

<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">

<label for="num2">Number 2:</label>


<input type="number" id="num2" placeholder="Enter second number">

<bu on onclick="subtract()">Subtract</bu on>

<div class="result" id="result"></div>


</div>
<script>
func on subtract() {

const num1 = parseFloat(document.getElementById("num1").value);


const num2 = parseFloat(document.getElementById("num2").value);

if (isNaN(num1) || isNaN(num2)) {
document.getElementById("result").innerText = "Please enter valid numbers.";
} else {

const result = num1 - num2;

document.getElementById("result").innerText = "Result: " + result;


}
}
</script>
</body>
</html>
Output :-

Marks Obtained Dated signature of


Teacher
Process Related(15) Product Related(10) Total(25)
PRACTICAL NO. 11

Aim: Develop a Webpage for Implementing Slideshow banner.

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.

Creating Rotating Banner Ads


Rotating banners ads comprises several banner images that constantly rotate on a
webpage at a fix time interval. You can create these banner images using standard
graphics tools. Let's create four banner images and name them as banner1.jpg,
banner2.jpg, banner3.jpg and banner4.jpg
The JavaScript starts by declaring an array to store the banner images using the new
Array keywords, as follows

MyBanners=new Array('banner1.jpg', 'banner2.jpg', 'banner3.jpg', 'banner4.jpg")


Each element in the array is assigned with an index, starting from 0. In our example,
banner1.jpg is assigned with index 0, banner2.jpg is assigned with index 1,
banner3.jpg is assigned with index 2 and banner3.jpg is assigned with index 3.

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:-

Marks Obtained Dated signature of


Teacher
Process Related(15) Product Related(10) Total(25)
PRACTICAL NO. 12

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:-

Marks Obtained Dated signature of


Teacher
Process Related(15) Product Related(10) Total(25)

Potrebbero piacerti anche