SlideShare uma empresa Scribd logo
1 de 31
 EMBED JAVASCRIPT INTO HTML
<html>
<head>
<title>Javascript: Good Morning All of u</title>
<script>
alert("Good morning All of u");
</script>
</head>
<body>
<p>This message only display a massage box.</p></body>
</html>
2. JAVASCRIPT CODE TO DEMONSTRATE CONDITIONAL STATEMENTS
IF STATEMENT :
<html>
<body>
<script>
var a=20;
if(a>10)
{
document.write("value of a is greater than 10");
}
</script>
</body>
</html>
IF…. ELSE STATEMENT :
<html>
<body>
<script>
var a=20;
if(a%2==0){
document.write("a is even number");
}
else{
document.write("a is odd number");
}
</script>
</body>
</html>
IF...ELSE IF STATEMENT :
<html>
<body>
<script>
var a=20;
if(a==10){
document.write("a is equal to 10");
}
else if(a==15){
document.write("a is equal to 15");
}
else if(a==20){
document.write("a is equal to 20");
}
else{
document.write("a is not equal to 10, 15 or 20");
}
</script>
</body>
</html>
SWITCH STATEMENT :
<!DOCTYPE html>
<html>
<body>
<script>
var grade='B';
var result;
switch(grade){
case 'A':
result="A Grade";
break;
case 'B':
result="B Grade";
break;
case 'C':
result="C Grade";
break;
default:
result="No Grade";
}
document.write(result);
</script>
</body></html>
3.JAVASCRIPT CODE TO DEMONSTRATE LOOPING
STATEMENTS:
JAVASCRIPTFOR LOOP :
<!DOCTYPE html>
<html>
<body>
<script>
for (i=1; i<=; i++) 5
{
document.write(i + "<br/>")
}
</script>
</body>
</html>
JAVASCRIPT WHILE LOOP :
while (condition)
{
code to be executed
}
<!DOCTYPE html>
<html>
<body>
<script>
vari=11;
while (i<=15)
{
document.write(i + "<br/>");
i++;
}
</script>
</body>
</html>
JavaScript do while loop :
<!DOCTYPE html>
<html>
<body>
<script>
vari=21;
do{
document.write(i + "<br/>");
i++;
}while(i<=25);
</script>
</body>
</html>
4.JavaScript code to demonstrate different string functions.
string replace :
<!DOCTYPE html>
<html>
<body>
<script>
varstr="Javatpoint";
document.writeln(str.replace("tpoint","Script"));
</script>
</body>
</html>
String toLowerCase() :
<html>
<body>
<script>
varstr = "BCA";
document.writeln(str.toLowerCase());
</script>
</body>
</html>
String toUpperCase() :
<html>
<body>
<script>
varstr = "bca";
document.writeln(str.toUpperCase());
</script>
</body>
</html>
String indexOf() :
<html>
<body>
<script>
var web="Hello Friends";
document.write(web.lastIndexOf('F'));
</script>
</body>
</html>
String slice() :
<html>
<body>
<script>
varstr = "Maharashtra";
document.writeln(str.slice(2,10));
</script>
</body>
</html>
5.JavaScript code to demonstrate onblur, onfocus, onload, onsubmit. :
Onfocus-
<!DOCTYPE html>
<html>
<body>
<h1>HTML DOM Events</h1>
<h2>The focus Event</h2>
Enter your name: <input type="text" onfocus="myFunction(this)">
<p>When the input field gets focus, a function changes the background-
color.</p>
<script>
functionmyFunction(x) {
x.style.background = "yellow";
}
</script>
</body>
</html>
Onload-
<html>
<body onload="myFunction()">
<h1>HTML DOM Events</h1>
<h2>Theonload Event</h2>
<script>
functionmyFunction() {
alert("Page is loaded");
}
</script>
</body>
</html>
Onblur-
<html>
<body>
<h1>HTML DOM Events</h1>
<h2>The blur Event</h2>
Enter your name: <input type="text" id="fname" onblur="myFunction()">
<p>When you leave the input field, a function is triggered which transforms
the input text to upper case.</p>
<script>
functionmyFunction() {
let x = document.getElementById("fname");
x.value = x.value.toUpperCase();
}
</script>
</body>
</html>
Onsubmit-
<html>
<body>
<p>When you submit the form, a function is triggered which alerts some
text.</p>
<form action="/action_page.php" onsubmit="myFunction()">
Enter name: <input type="text" name="fname">
<input type="submit" value="Submit">
</form>
<script>
functionmyFunction() {
alert("The form was submitted");
}
</script>
</body>
</html>
6.JavaScript code to demonstrate onkeypress, onmouseover,
onmouseout :
Onmouseover -
<html>
<head>
<h1>Javascript Events </h1>
</head>
<body>
<script language="Javascript" type="text/Javascript">
<!--
functionmouseoverevent()
{
alert("This is JavaTpoint");
}
//-->
</script>
<p onmouseover="mouseoverevent()"> Keep cursor over me</p>
</body>
</html>
Onmouseout-
<html>
<head>
<script>
<!--
functionsayHello(){
alert("Mouse Out")
}
//-->
</script>
</head>
<body>
<ponmouseout="sayHello()">This is demo text for mouseover event.</p>
</body>
</html>
Onkeypress-
<!DOCTYPE html>
<html>
<body>
<h1>HTML DOM Events</h1>
<h2>Theonkeypress Event</h2>
<p>A function is triggered when the user is pressing a key in the input
field.</p>
<input type="text" onkeypress="myFunction()">
<script>
functionmyFunction() {
alert("You pressed a key inside the input field");
}
</script>
</body>
</html>
7. Addition of two numbers :
public class Main {
public static void main(String[] args) {
int x = 5;
int y = 6;
int sum = x + y;
System.out.println(sum); }
}
8. demonstrate Date object :
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Dates</h1>
<h2>Using new Date()</h2>
<p id="demo"></p>
<script>
const d = new Date("2022-03-25");
document.getElementById("demo").innerHTML = d;
</script>
</body>
</html>
9.demonstrate use of Dialog Boxes.
<html>
<head>
<script type="text/javascript">
function show() {
var con = confirm ("It is a Confirm dialog box");
if(con == true) {
document.write ("User Want to continue");
}
11.form validation – not null, number, string etc
not null :
function required()
{
var empt = document.forms["form1"]["text1"].value;
if (empt == "")
{
alert("Please input a Value");
return false;
}
else
{
alert('Code has accepted : you can try another');
return true;
}
}
Number :
function allnumeric(inputtxt)
{
var numbers = /^[0-9]+$/;
if(inputtxt.value.match(numbers))
{
alert('Your Registration number has accepted....');
document.form1.text1.focus();
return true;
}
else
{
alert('Please input numeric characters only');
document.form1.text1.focus();
return false;
}
}
String :
function lengthRange(inputtxt, minlength, maxlength)
{
var userInput = inputtxt.value;
if(userInput.length >= minlength && userInput.length <=
maxlength)
{
return true;
}
else
{
alert("Please input between " +minlength+ " and "
+maxlength+ " characters");
return false;
}
}
11.Simple registration form using Bootstrap :
<section class="vh-100 gradient-custom">
<div class="container py-5 h-100">
<div class="row justify-content-center align-items-center h-100">
<div class="col-12 col-lg-9 col-xl-7">
<div class="card shadow-2-strong card-registration" style="border-radius: 15px;">
<div class="card-body p-4 p-md-5">
<h3 class="mb-4 pb-2 pb-md-0 mb-md-5">Registration Form</h3>
<form>
<div class="row">
<div class="col-md-6 mb-4">
<div class="form-outline">
<input type="text" id="firstName" class="form-control form-control-lg" />
<label class="form-label" for="firstName">First Name</label>
</div>
</div>
<div class="col-md-6 mb-4">
<div class="form-outline">
<input type="text" id="lastName" class="form-control form-control-lg" />
<label class="form-label" for="lastName">Last Name</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 mb-4 d-flex align-items-center">
<div class="form-outline datepicker w-100">
<input type="text" class="form-control form-control-lg" id="birthdayDate" />
<label for="birthdayDate" class="form-label">Birthday</label>
</div>
</div>
<div class="col-md-6 mb-4">
<h6 class="mb-2 pb-1">Gender: </h6>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="inlineRadioOptions"
id="femaleGender"
value="option1" checked />
<label class="form-check-label" for="femaleGender">Female</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="inlineRadioOptions"
id="maleGender"
value="option2" />
<label class="form-check-label" for="maleGender">Male</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="inlineRadioOptions"
id="otherGender"
value="option3" />
<label class="form-check-label" for="otherGender">Other</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 mb-4 pb-2">
<div class="form-outline">
<input type="email" id="emailAddress" class="form-control form-control-lg" />
<label class="form-label" for="emailAddress">Email</label>
</div>
</div>
<div class="col-md-6 mb-4 pb-2">
<div class="form-outline">
<input type="tel" id="phoneNumber" class="form-control form-control-lg" />
<label class="form-label" for="phoneNumber">Phone Number</label>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<select class="select form-control-lg">
<option value="1" disabled>Choose option</option>
<option value="2">Subject 1</option>
<option value="3">Subject 2</option>
<option value="4">Subject 3</option>
</select>
<label class="form-label select-label">Choose option</label>
</div>
</div>
<div class="mt-4 pt-2">
<input class="btn btn-primary btn-lg" type="submit" value="Submit" />
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</section>

Mais conteúdo relacionado

Semelhante a WEB DESIGN PRACTICLE bca

Shangz R Brown Presentation
Shangz R Brown PresentationShangz R Brown Presentation
Shangz R Brown Presentationshangbaby
 
28,29. procedures subprocedure,type checking functions in VBScript
28,29. procedures  subprocedure,type checking functions in VBScript28,29. procedures  subprocedure,type checking functions in VBScript
28,29. procedures subprocedure,type checking functions in VBScriptVARSHAKUMARI49
 
Cnam azure 2014 mobile services
Cnam azure 2014   mobile servicesCnam azure 2014   mobile services
Cnam azure 2014 mobile servicesAymeric Weinbach
 
Pengenalan AngularJS
Pengenalan AngularJSPengenalan AngularJS
Pengenalan AngularJSEdi Santoso
 
Basics of Java Script (JS)
Basics of Java Script (JS)Basics of Java Script (JS)
Basics of Java Script (JS)Ajay Khatri
 
javascript-variablesanddatatypes-130218094831-phpapp01.pdf
javascript-variablesanddatatypes-130218094831-phpapp01.pdfjavascript-variablesanddatatypes-130218094831-phpapp01.pdf
javascript-variablesanddatatypes-130218094831-phpapp01.pdfAlexShon3
 
Webdesing lab part-b__java_script_
Webdesing lab part-b__java_script_Webdesing lab part-b__java_script_
Webdesing lab part-b__java_script_Shivanand Algundi
 
Html basics 11 form validation
Html basics 11 form validationHtml basics 11 form validation
Html basics 11 form validationH K
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd marchRajeev Sharan
 
Angular js - 4developers 12 kwietnia 2013
Angular js - 4developers 12 kwietnia 2013Angular js - 4developers 12 kwietnia 2013
Angular js - 4developers 12 kwietnia 2013Marcin Wosinek
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Dan Wahlin
 

Semelhante a WEB DESIGN PRACTICLE bca (20)

Shangz R Brown Presentation
Shangz R Brown PresentationShangz R Brown Presentation
Shangz R Brown Presentation
 
JavaScript Operators
JavaScript OperatorsJavaScript Operators
JavaScript Operators
 
FSJavaScript.ppt
FSJavaScript.pptFSJavaScript.ppt
FSJavaScript.ppt
 
28,29. procedures subprocedure,type checking functions in VBScript
28,29. procedures  subprocedure,type checking functions in VBScript28,29. procedures  subprocedure,type checking functions in VBScript
28,29. procedures subprocedure,type checking functions in VBScript
 
Web 11 | AJAX + JSON + PHP
Web 11 | AJAX + JSON + PHPWeb 11 | AJAX + JSON + PHP
Web 11 | AJAX + JSON + PHP
 
Cnam azure 2014 mobile services
Cnam azure 2014   mobile servicesCnam azure 2014   mobile services
Cnam azure 2014 mobile services
 
Pengenalan AngularJS
Pengenalan AngularJSPengenalan AngularJS
Pengenalan AngularJS
 
JavaScript Refactoring
JavaScript RefactoringJavaScript Refactoring
JavaScript Refactoring
 
Web lab programs
Web lab programsWeb lab programs
Web lab programs
 
Basics of Java Script (JS)
Basics of Java Script (JS)Basics of Java Script (JS)
Basics of Java Script (JS)
 
javascript-variablesanddatatypes-130218094831-phpapp01.pdf
javascript-variablesanddatatypes-130218094831-phpapp01.pdfjavascript-variablesanddatatypes-130218094831-phpapp01.pdf
javascript-variablesanddatatypes-130218094831-phpapp01.pdf
 
Webdesing lab part-b__java_script_
Webdesing lab part-b__java_script_Webdesing lab part-b__java_script_
Webdesing lab part-b__java_script_
 
Html basics 11 form validation
Html basics 11 form validationHtml basics 11 form validation
Html basics 11 form validation
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd march
 
Lab final
Lab finalLab final
Lab final
 
Angular js - 4developers 12 kwietnia 2013
Angular js - 4developers 12 kwietnia 2013Angular js - 4developers 12 kwietnia 2013
Angular js - 4developers 12 kwietnia 2013
 
Java script
Java scriptJava script
Java script
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
 
phptut2
phptut2phptut2
phptut2
 
phptut2
phptut2phptut2
phptut2
 

Mais de YashKoli22

Distrubutated control system elecal.pptx
Distrubutated control system elecal.pptxDistrubutated control system elecal.pptx
Distrubutated control system elecal.pptxYashKoli22
 
CPP-Unit 1.pptx
CPP-Unit 1.pptxCPP-Unit 1.pptx
CPP-Unit 1.pptxYashKoli22
 
YASH HTML CODES
YASH HTML CODESYASH HTML CODES
YASH HTML CODESYashKoli22
 
YASH HTML CODE
YASH HTML CODE YASH HTML CODE
YASH HTML CODE YashKoli22
 
pptparking-160731172031 (1).pdf
pptparking-160731172031 (1).pdfpptparking-160731172031 (1).pdf
pptparking-160731172031 (1).pdfYashKoli22
 
yash [Autosaved].pptx
yash [Autosaved].pptxyash [Autosaved].pptx
yash [Autosaved].pptxYashKoli22
 

Mais de YashKoli22 (7)

Distrubutated control system elecal.pptx
Distrubutated control system elecal.pptxDistrubutated control system elecal.pptx
Distrubutated control system elecal.pptx
 
CPP-Unit 1.pptx
CPP-Unit 1.pptxCPP-Unit 1.pptx
CPP-Unit 1.pptx
 
YASH HTML CODES
YASH HTML CODESYASH HTML CODES
YASH HTML CODES
 
YASH HTML CODE
YASH HTML CODE YASH HTML CODE
YASH HTML CODE
 
topology.pptx
topology.pptxtopology.pptx
topology.pptx
 
pptparking-160731172031 (1).pdf
pptparking-160731172031 (1).pdfpptparking-160731172031 (1).pdf
pptparking-160731172031 (1).pdf
 
yash [Autosaved].pptx
yash [Autosaved].pptxyash [Autosaved].pptx
yash [Autosaved].pptx
 

Último

Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 

Último (20)

Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 

WEB DESIGN PRACTICLE bca

  • 1.  EMBED JAVASCRIPT INTO HTML <html> <head> <title>Javascript: Good Morning All of u</title> <script> alert("Good morning All of u"); </script> </head> <body> <p>This message only display a massage box.</p></body> </html>
  • 2. 2. JAVASCRIPT CODE TO DEMONSTRATE CONDITIONAL STATEMENTS IF STATEMENT : <html> <body> <script> var a=20; if(a>10) { document.write("value of a is greater than 10"); } </script> </body> </html>
  • 3. IF…. ELSE STATEMENT : <html> <body> <script> var a=20; if(a%2==0){ document.write("a is even number"); } else{ document.write("a is odd number"); } </script> </body> </html>
  • 4. IF...ELSE IF STATEMENT : <html> <body> <script> var a=20; if(a==10){ document.write("a is equal to 10"); } else if(a==15){ document.write("a is equal to 15"); } else if(a==20){ document.write("a is equal to 20"); } else{ document.write("a is not equal to 10, 15 or 20"); } </script> </body> </html>
  • 5. SWITCH STATEMENT : <!DOCTYPE html> <html> <body> <script> var grade='B'; var result; switch(grade){ case 'A': result="A Grade"; break; case 'B': result="B Grade"; break; case 'C': result="C Grade"; break; default: result="No Grade"; } document.write(result); </script> </body></html>
  • 6. 3.JAVASCRIPT CODE TO DEMONSTRATE LOOPING STATEMENTS: JAVASCRIPTFOR LOOP : <!DOCTYPE html> <html> <body> <script> for (i=1; i<=; i++) 5 { document.write(i + "<br/>") } </script> </body> </html>
  • 7. JAVASCRIPT WHILE LOOP : while (condition) { code to be executed } <!DOCTYPE html> <html> <body> <script> vari=11; while (i<=15) { document.write(i + "<br/>"); i++; } </script> </body> </html>
  • 8. JavaScript do while loop : <!DOCTYPE html> <html> <body> <script> vari=21; do{ document.write(i + "<br/>"); i++; }while(i<=25); </script> </body> </html>
  • 9. 4.JavaScript code to demonstrate different string functions. string replace : <!DOCTYPE html> <html> <body> <script> varstr="Javatpoint"; document.writeln(str.replace("tpoint","Script")); </script> </body> </html>
  • 10. String toLowerCase() : <html> <body> <script> varstr = "BCA"; document.writeln(str.toLowerCase()); </script> </body> </html>
  • 11. String toUpperCase() : <html> <body> <script> varstr = "bca"; document.writeln(str.toUpperCase()); </script> </body> </html>
  • 12. String indexOf() : <html> <body> <script> var web="Hello Friends"; document.write(web.lastIndexOf('F')); </script> </body> </html>
  • 13. String slice() : <html> <body> <script> varstr = "Maharashtra"; document.writeln(str.slice(2,10)); </script> </body> </html>
  • 14. 5.JavaScript code to demonstrate onblur, onfocus, onload, onsubmit. : Onfocus- <!DOCTYPE html> <html> <body> <h1>HTML DOM Events</h1> <h2>The focus Event</h2> Enter your name: <input type="text" onfocus="myFunction(this)"> <p>When the input field gets focus, a function changes the background- color.</p> <script> functionmyFunction(x) { x.style.background = "yellow"; } </script> </body> </html>
  • 15. Onload- <html> <body onload="myFunction()"> <h1>HTML DOM Events</h1> <h2>Theonload Event</h2> <script> functionmyFunction() { alert("Page is loaded"); } </script> </body> </html>
  • 16. Onblur- <html> <body> <h1>HTML DOM Events</h1> <h2>The blur Event</h2> Enter your name: <input type="text" id="fname" onblur="myFunction()"> <p>When you leave the input field, a function is triggered which transforms the input text to upper case.</p> <script> functionmyFunction() { let x = document.getElementById("fname"); x.value = x.value.toUpperCase(); } </script> </body> </html>
  • 17. Onsubmit- <html> <body> <p>When you submit the form, a function is triggered which alerts some text.</p> <form action="/action_page.php" onsubmit="myFunction()"> Enter name: <input type="text" name="fname"> <input type="submit" value="Submit"> </form> <script> functionmyFunction() { alert("The form was submitted"); } </script> </body> </html>
  • 18. 6.JavaScript code to demonstrate onkeypress, onmouseover, onmouseout : Onmouseover - <html> <head> <h1>Javascript Events </h1> </head> <body> <script language="Javascript" type="text/Javascript"> <!-- functionmouseoverevent() { alert("This is JavaTpoint"); } //--> </script> <p onmouseover="mouseoverevent()"> Keep cursor over me</p> </body> </html>
  • 20. Onkeypress- <!DOCTYPE html> <html> <body> <h1>HTML DOM Events</h1> <h2>Theonkeypress Event</h2> <p>A function is triggered when the user is pressing a key in the input field.</p> <input type="text" onkeypress="myFunction()"> <script> functionmyFunction() { alert("You pressed a key inside the input field"); } </script> </body> </html>
  • 21. 7. Addition of two numbers : public class Main { public static void main(String[] args) { int x = 5; int y = 6; int sum = x + y; System.out.println(sum); } }
  • 22. 8. demonstrate Date object : <!DOCTYPE html> <html> <body> <h1>JavaScript Dates</h1> <h2>Using new Date()</h2> <p id="demo"></p> <script> const d = new Date("2022-03-25"); document.getElementById("demo").innerHTML = d; </script> </body> </html>
  • 23. 9.demonstrate use of Dialog Boxes. <html> <head> <script type="text/javascript"> function show() { var con = confirm ("It is a Confirm dialog box"); if(con == true) { document.write ("User Want to continue"); }
  • 24. 11.form validation – not null, number, string etc not null : function required() { var empt = document.forms["form1"]["text1"].value; if (empt == "") { alert("Please input a Value"); return false; } else { alert('Code has accepted : you can try another'); return true; } }
  • 25. Number : function allnumeric(inputtxt) { var numbers = /^[0-9]+$/; if(inputtxt.value.match(numbers)) { alert('Your Registration number has accepted....'); document.form1.text1.focus(); return true; } else { alert('Please input numeric characters only'); document.form1.text1.focus(); return false; } }
  • 26. String : function lengthRange(inputtxt, minlength, maxlength) { var userInput = inputtxt.value; if(userInput.length >= minlength && userInput.length <= maxlength) { return true; } else { alert("Please input between " +minlength+ " and " +maxlength+ " characters"); return false; } }
  • 27. 11.Simple registration form using Bootstrap : <section class="vh-100 gradient-custom"> <div class="container py-5 h-100"> <div class="row justify-content-center align-items-center h-100"> <div class="col-12 col-lg-9 col-xl-7"> <div class="card shadow-2-strong card-registration" style="border-radius: 15px;"> <div class="card-body p-4 p-md-5"> <h3 class="mb-4 pb-2 pb-md-0 mb-md-5">Registration Form</h3> <form> <div class="row"> <div class="col-md-6 mb-4"> <div class="form-outline"> <input type="text" id="firstName" class="form-control form-control-lg" /> <label class="form-label" for="firstName">First Name</label> </div> </div> <div class="col-md-6 mb-4"> <div class="form-outline"> <input type="text" id="lastName" class="form-control form-control-lg" /> <label class="form-label" for="lastName">Last Name</label> </div>
  • 28. </div> </div> <div class="row"> <div class="col-md-6 mb-4 d-flex align-items-center"> <div class="form-outline datepicker w-100"> <input type="text" class="form-control form-control-lg" id="birthdayDate" /> <label for="birthdayDate" class="form-label">Birthday</label> </div> </div> <div class="col-md-6 mb-4"> <h6 class="mb-2 pb-1">Gender: </h6> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="inlineRadioOptions" id="femaleGender" value="option1" checked /> <label class="form-check-label" for="femaleGender">Female</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="inlineRadioOptions" id="maleGender" value="option2" />
  • 29. <label class="form-check-label" for="maleGender">Male</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="inlineRadioOptions" id="otherGender" value="option3" /> <label class="form-check-label" for="otherGender">Other</label> </div> </div> </div> <div class="row"> <div class="col-md-6 mb-4 pb-2"> <div class="form-outline"> <input type="email" id="emailAddress" class="form-control form-control-lg" /> <label class="form-label" for="emailAddress">Email</label> </div> </div> <div class="col-md-6 mb-4 pb-2"> <div class="form-outline"> <input type="tel" id="phoneNumber" class="form-control form-control-lg" />
  • 30. <label class="form-label" for="phoneNumber">Phone Number</label> </div> </div> </div> <div class="row"> <div class="col-12"> <select class="select form-control-lg"> <option value="1" disabled>Choose option</option> <option value="2">Subject 1</option> <option value="3">Subject 2</option> <option value="4">Subject 3</option> </select> <label class="form-label select-label">Choose option</label> </div> </div> <div class="mt-4 pt-2"> <input class="btn btn-primary btn-lg" type="submit" value="Submit" /> </div> </form> </div>