Beruflich Dokumente
Kultur Dokumente
HTML5 offers new semantic elements to define different parts of a web page:
● <article>
● <aside>
● <details>
● <figcaption>
● <figure>
● <footer>
● <header>
● <main>
● <mark>
● <nav>
● <section>
● <summary>
● <time>
SECTION TAG:
The section element defines a section in a document.
According to W3C's HTML5 documentation: "A section is a thematic grouping of content,
typically with a heading."
A home page could normally be split into sections for introduction, content, and contact
information.
ARTICLE TAG:
An article should make sense on its own, and it should be possible to read it independently
from the rest of the web site.
● Forum post
● Blog post
● Newspaper article
HEADER TAG:
The <header> element specifies a header for a document or section.
The <header> element should be used as a container for introductory content.
You can have several <header> elements in one document.
FOOTER TAG:
The <footer> element specifies a footer for a document or section.
A <footer> element should contain information about its containing element.
A footer typically contains the author of the document, copyright information, links to terms
of use, contact information, etc.
NAV TAG:
The <nav> element defines a set of navigation links.
ASIDE TAG:
The <aside> element defines some content aside from the content it is placed in (like a
sidebar).
The <aside> content should be related to the surrounding content.
FIGURE TAG:
The purpose of a figure caption is to add a visual explanation to an image.
In HTML5, an image and a caption can be grouped together in a <figure> element:
PROGRAM:
<!DOCTYPE html>
<html>
<body>
<section>
<h1>WEBPROGRAMMING</h1>
<h1>SECTION TAG</h1>
<p>The <section> element represents a generic section of a document or application.
A section, in this context, is a thematic grouping of content. Each section should be
identified, typically by including a heading (h1-h6 element) as a child of the
<section> element.</p>
</section>
<article>
<h1>ARTICLE TAG</h1>
<p>The <article> tag is one of the new semantic elements introduced with HTML5.
According to the HTML5 specification : The article element represents a section of
content that forms an independent part of a document or site; for example, a magazine
or newspaper article, or a blog entry.</p>
</article>
<footer>
<p>The <footer> element specifies a footer for a document or section.
A footer element should contain information about its containing element.
A footer typically contains the author of the document, copyright information, links to
terms of use, contact information, etc.
You may have several footer elements in one document.</p>
</footer>
<nav>
<a href="/html/">HTML</a> |
<a href="/css/">CSS</a> |
<a href="/js/">JavaScript</a> |
<a href="/jquery/">jQuery</a>
</nav>
<figure>
<imgsrc="img123.jpg">
<figcaption>Fig1. - img,img1.</figcaption>
</figure>
<details>
<summary>Copyright 1999-2014.</summary>
<p> - by Refsnes Data. All Rights Reserved.</p>
<p>All content and graphics on this web site are the property of the company.</p>
</details>
</body>
</html>
OUTPUT:
Program:
<html>
<head>
<title>Media Elements</title>
</head>
<body style="background-color:powderblue;">
<h3 style="text-align:center;">Video</h3>
<video style="display:block; margin: 0 auto;" width="720" height="360"
controls>
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video></br>
<h3 style="text-align:center;">Audio</h3>
<audio style="display:block; margin: 0 auto;" controls>
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio tag.
</audio>
</body>
</html>
Output:
AIM:To write a HTML script and implement cascaded, embedded and inline style sheets.
PROCEDURE:
1. Create an embedded style sheet to apply style for unordered list in order to make it
display as horizontal menu
2. Setting the display property as inline , so that it displays the menu horizontally
3. Creating another html file which displays customer details
4. Created an external style sheet, used class selector to apply different formatting
for each row (<tr>) of the table .
5. The link tag is used in the html file to link the external style sheet.
6. The attributes of the link tag are set as follows :
type – text/css, href – name of the css file.
7. Customer menu item in Menu.html is linked to display the customer details using
href tag.
PROGRAM:
//Menu.html
<html>
<head>
<style type="text/css">
ul
{
list-style-type:none;
margin:0;
padding:0;
padding-top:6px;
padding-bottom:6px;
}
li
{
display:inline;
}
a:link,a:visited
{
font-weight:bold;
color:#FFFFFF;
background-color:#98bf21;
text-align:center;
padding:6px;
text-decoration:none;
text-transform:uppercase;
}
a:hover,a:active
{
background-color:#7A991A;
}
</style>
</head>
<body>
<ul>
<li><a href="home.html">Home</a></li>
<li><a href="customerdetail.html">Customers</a></li>
<li><a href="contact.html">Contact</a></li>
<li><a href="about.html">About</a></li>
</ul>
</body>
</html>
Style.css
#customers
{
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
width:100%;
border-collapse:collapse;
}
#customers td, #customers th
{
font-size:1em;
border:1px solid #98bf21;
padding:3px 7px 2px 7px;
}
#customers th
{
font-size:1.1em;
text-align:left;
padding-top:5px;
padding-bottom:4px;
background-color:#A7C942;
color:#ffffff;
}
#customers tr.alt td
{
color:#000000;
background-color:#EAF2D3;
}
Customerlist.html
<html>
<head>
<link rel=”stylesheet” type=”text/css” href=”style.css”>
</head>
<body>
<h1>CUSTOMER DETAILS</h1>
<table id="customers">
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>AlfredsFutterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr class="alt">
<td>Berglundssnabbköp</td>
<td>Christina Berglund</td>
<td>Sweden</td>
</tr>
<tr>
<td>Centro comercialMoctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
<tr class="alt">
<td>Ernst Handel</td>
<td>Roland Mendel</td>
<td>Austria</td>
</tr>
<tr>
<td>Island Trading</td>
<td>Helen Bennett</td>
<td>UK</td>
</tr>
<tr class="alt">
<td>Königlich Essen</td>
<td>Philip Cramer</td>
<td>Germany</td>
</tr>
<tr>
<td>Laughing Bacchus Winecellars</td>
<td>Yoshi Tannamuri</td>
<td>Canada</td>
</tr>
<tr class="alt">
<td>MagazziniAlimentariRiuniti</td>
<td>Giovanni Rovelli</td>
<td>Italy</td>
</tr>
<tr>
<td>North/South</td>
<td>Simon Crowther</td>
<td>UK</td>
</tr>
<tr class="alt">
<td>Paris spécialités</td>
<td>Marie Bertrand</td>
<td>France</td>
</tr>
</table>
</body>
</html>
Output:
Result:The given program was written and executed successfully and output was verified.
Exp. No.: 4 Validation Using JavaScript Date :
Result: Thus, a dynamic form with validation using JavaScript has been designed.
Exp. No.: 5 Servlet Date :
StudentServlet.java:
import java.io.*;
import java.util.*;
importjavax.servlet.*;
Aim: To write a jsp program for a html form and link it with a database.
Procedure:
● An online exam form is designed.
● Whenever the submit button is clicked, it is directed to the jsp program.
● The jsp program is compiled and run using Apache Tomcat Server and is connected to
ansql database using jdbc driver.
● The answer for each question is fetched from the form and marks are calculated.
● The Name, register no and marks are inserted into the database using
executeUpdate().
● The row is fetched using executeQuery() and is displayed in a table as ‘ Student Mark
Sheet’.
Program:
Questionform.html
<html>
<body>
<center>Online examination</center>
<form action="exam.jsp" method="post" name="frmquestions">
<table align="center">
<tr><td colspan="2">regno</td>
<td colspan="2"><input type="text" name="txtregno" value=""></td>
</tr>
<tr><td colspan="2">name</td>
<td colspan="2"><input type="text" name="txtname" value=""></td>
</tr>
</table>
<br/>
<p>
<b>Questions</b>
</p>
<table align ="left" border="0" width="80%">
<tr><td colspan="4">1.The orginator of www is</td></tr>
<tr><td>1.<input type="radio" name="q1" value="a"/>Bill Gates</td>
<td>2.<input type="radio" name="q1" value="b"/>John Mathew</td>
<td>3.<input type="radio" name="q1" value="c"/>TimBerner Lee</td>
<td>4.<input type="radio" name="q1" value="d"/>Geroge</td>
</tr>
<tr><td colspan="4">2.The servlet lifecycle as the method</td>
</tr>
<tr><td>1.<input type="radio" name="q2" value="a"/>service</td>
<td>2.<input type="radio" name="q2" value="b"/>getinfo</td>
<td>3.<input type="radio" name="q2" value="c"/>terminate</td>
<td>4.<input type="radio" name="q2" value="d"/>initialize</td>
</tr>
<tr>
<td colspan="4">3.w3c stands for is</td>
</tr>
<tr>
<td>1.<input type="radio" name="q3" value="a"/>www corporation</td>
<td>2.<input type="radio" name="q3" value="b"/>world web consortium</td>
<td>3.<input type="radio" name="q3" value="c"/>world 3 corp</td>
<td>4.<input type="radio" name="q3" value="d"/>www console</td>
</tr>
<tr>
<td colspan="4">4.HTML stands for is</td>
</tr>
<tr>
<td>1.<input type="radio" name="q4" value="a"/>Hyper textmarkup language</td>
<td>2.<input type="radio" name="q4" value="b"/>Hyper text mark language</td>
<td>3.<input type="radio" name="q4" value="c"/>High text markup language</td>
<td>4.<input type="radio" name="q4" value="d"/>High texmarkup language </td>
</tr>
<tr>
<td colspan="4">5.TCP stands for is</td>
</tr>
<tr>
<td>1.<input type="radio" name="q5" value="a"/>Transfer control protocol</td>
<td>2.<input type="radio" name="q5" value="b"/>Transmission control
protocol</td>
<td>3.<input type="radio" name="q5" value="c"/>Transition control protocol </td>
<td>4.<input type="radio" name="q5" value="d"/>Transmission central
protocol</td>
</tr>
<tr><td colspan="4"> </td></tr>
<tr><td colspan="4"> </td></tr>
<tr><td colspan="2"><input type="submit" name="sbtans" value="Submit"/></td>
<td colspan="2"><input type="reset" name="reset" value="Reset"/></td>
</tr>
</table>
<br/>
</form>
</body>
</html>
Exam.jsp
<%@ page language ="java" import = "java.sql.*"%>
<%@ page import="java.io.*"%>
<%@ page import ="java.util.*"%>
<%
String regno="",name="";
String ans1,ans2,ans3,ans4,ans5,insquery;
intcntcorrect=0;
Connection conn = null;
Statement stmt=null;
ResultSetrs = null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc:odbc:exam";
conn = DriverManager.getConnection(url," "," ");
if (request.getParameter("txtregno") != null) {
regno = request.getParameter("txtregno");
name = request.getParameter("txtname");
ans1 = request.getParameter("q1");
ans2 = request.getParameter("q2");
ans3 = request.getParameter("q3");
ans4 = request.getParameter("q4");
ans5 = request.getParameter("q5");
if (ans1.equalsIgnoreCase("c"))
cntcorrect = cntcorrect + 2;
if (ans2.equalsIgnoreCase("a"))
cntcorrect = cntcorrect + 2;
if (ans3.equalsIgnoreCase("b"))
cntcorrect = cntcorrect + 2;
if (ans4.equalsIgnoreCase("a"))
cntcorrect = cntcorrect + 2;
if (ans5.equalsIgnoreCase("b"))
cntcorrect = cntcorrect + 2;
}
insquery = "INSERT into Studentmark values (" + regno + ",'" + name +"'," +
cntcorrect + ")";
stmt = conn.createStatement();
int result = stmt.executeUpdate(insquery);
//out.println(insquery);
stmt.close();
stmt = conn.createStatement();
String query="Select * from StudentMark where regno = "+ regno ;
rs = stmt.executeQuery(query);
%>
<html>
<body>
<center><h2> Online Examination </h2><h2 > Student Mark Sheet </h2>
<h3> Name of College : SRM Institute of Science and Technology </h3></center>
<p></p>
<table border="1" cellspacing="0" cellpadding="0" align="center" width="40%">
<tr><td> Regno </td><td> Name </td><td> Marks </td></tr>
<% while (rs.next())
{ %>
<tr><td><%= rs.getInt(1) %></td>
<td><%= rs.getString(2) %></td>
<td><%=rs.getInt(3) %></td>
<%
}
rs.close();
stmt.close();
conn.close();
%>
</table>
<br/>
<table>
<tr><td><b> Date : <%=new java.util.Date().toString() %></b></td></tr>
<tr><td><b> Signature </b><i> Manish </i></td></tr>
</table>
</body>
</html>
Output:
AIM:
ALGORITHM:
PROGRAM:
package com.journaldev.servlets;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/GetUserServlet")
public class GetUserServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
<script src="//code.jquery.com/jquery-1.10.2.js"
type="text/javascript"></script>
<script src="js/app-ajax.js" type="text/javascript"></script>
</head>
<body>
<form>
Enter Your Name: <input type="text" id="userName" />
</form>
<br>
<br>
<strong>Ajax Response</strong>:
<div id="ajaxGetUserServletResponse"></div>
</body>
</html>
app-ajax.js_code:
$(document).ready(function() {
$('#userName').blur(function() {
$.ajax({
url : 'GetUserServlet',
data : {userName : $('#userName').val()
},
success : function(responseText) {
$('#ajaxGetUserServletResponse').text(responseText);
}});});});
OUTPUT:
RESULT:
Thus a program to implement JSP and AJAX was executed and the output is verified.
Exp. No.: 8 Invoking PHP using HTML Date :
Program:
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-
8"></head>
<body>
<div>
<h1>Employee Detail</h1>
<form action="http://result.php" method="post" target="_blank" onsubmit="try
{return window.confirm("You are submitting information to an external
page.\nAre you sure?");} catch (e) {return false;}">
<table border="0" cellspacing="5" cellpadding="5">
<tr>
<td>Employee Code</td>
<td><input type="text" name="txtcode"><br></td>
</tr>
<tr>
<td>Employee Name:</td>
<td><input type="text" name="name"><br></td>
</tr>
<tr>
<td>E-mail:</td>
<td><input type="email" name="email"><br></td>
</tr>
<tr>
<td>Contact No:</td>
<td><input type="text" name="contact"><br></td>
</tr>
<tr>
<td>Basic Pay</td>
<td><input type="text" name="txtpay"></td>
</tr>
<tr>
<td>Dearness Allowance</td>
<td><input type="text" name="txtda"></td>
</tr>
<tr>
<td>House Rent Allowance</td>
<td><input type="text" name="txthra"></td>
</tr>
<tr><td colspan="2"><b> Employee Deductions</b></td></tr>
<tr>
<td>Employee Provident Fund</td>
<td><input type="text" name="txtpf"></td>
</tr>
<tr>
<td>Staff Welfare</td>
<td><input type="text" name="txtstaff"></td>
</tr>
<tr>
<td><input type="submit" name="sbtsubmit" value="Submit"></td>
<td><input type="reset" name="rstcancel" value="Cancel"></td>
</tr>
</table>
</form>
</div>
</body>
</html>
Result.php
<html>
<body>
<table align="center" border="5">
<td><?php echo "Date :".date("d/m/Y")?></td>
<td><h2 align="center">Employee - PaySlip for the Month of October
2018</h1></td>
<td><?php echo "Time :" . date("h:i:sa")?></td>
</table>
<br/> <br/>
<?php
$allowance = $_POST["txtpay"] + $_POST["txtda"] + $_POST["txthra"];
$ded =$_POST["txtpf"]+ $_POST["txtstaff"] ;
$netpay = $allowance - $ded;
?>
<table align="center" cellspacing="5" cellpadding="5">
<tr>
<td><b> Employee Code: </b></td>
<td><?php echo $_POST["name"]?></td>
</tr>
<tr>
<td><b> Employee Code: </b></td>
<td><?php echo $_POST["txtcode"]?></td>
</tr>
<tr>
<td><b> Employee Name: </b></td>
<td><?php echo $_POST["name"]?></td>
</tr>
<tr>
<td><b> Basic Pay: </b></td>
<td><?php echo $_POST["txtpay"]?></td>
</tr>
<tr>
<td><b> DA : </b></td>
<td><?php echo $_POST["txtda"]?></td>
</tr>
<tr>
<td><b> HRA : </b></td>
<td><?php echo $_POST["txthra"]?></td>
</tr>
<tr>
<td colspan="2"><b> Deductions : </b></td>
</tr>
<tr>
<td><b> EPF : </b></td>
<td><?php echo $_POST["txtpf"]?></td>
</tr>
<tr>
<td><b> Staff Welfare : </b></td>
<td><?php echo $_POST["txtstaff"]?></td>
</tr>
<tr>
<td><b> NET SALARY </td>
<td><?php echo $netpay ?></td>
</tr>
</table>
<br/>
</body>
</html>
Output:
Program:
index.php
<html>
<script type="text/javascript">
function showName(str) {
document.getElementById("txtName").innerHTML=xmlhttp.responseText;
xmlhttp.open("GET","frameworks.php?name="+str,true);
xmlhttp.send();
</script>
</head>
<body>
</form>
</body>
</html>
FRAMEWORK.php
<?php
$frameworks = array("Prateek","Aman","Aditya","Yash",
"Gupta","Bala","Charan","Chethan","Sandeep","Ankush","Singh") ;
$name = $_GET["name"];
if (strlen($name) > 0) {
$match = "";
if (strtolower($name) == strtolower(substr($frameworks[$i], 0,
strlen($name)))) {
if ($match == "") {
$match = $frameworks[$i];
} else {
?>
Output:
Result: Thus, a simple application using AJAX and PHP was executed successfully.
Exp. No.: 10 Accessing XML Data Using DOM Date :
Aim: Simple application for accessing the data using XML-DOM Parser.
Procedure:
● A html page is designed.
● The ID writersXML is defined as the XML object first, and then it becomes part of a
document.firstChild..
● writers.xml the script just keeps adding .firstChild to each of the elements.
Program:
readFirstChild.html
<html>
<head>
<style>
body {
font-family:verdana;
color:#ff4d00;
font-size:14pt;
font-weight:bold;
background-color:#678395;
}
div {background-color:#c1d4cc;}
#blueBack {background-color:#c1d4cc}
</style>
<title>Read First Child</title>
<xml ID="writersXML"
SRC="writers.xml"></xml>
<script language="JavaScript">
functionfindWriter() {
varmyXML, writersNode, languageNode,
varpenNode,nameNode,display
myXML= document.all("writersXML").XMLDocument
writersNode = myXML.documentElement
languageNode = writersNode.firstChild
fictionNode = languageNode.firstChild
penNode = fictionNode.firstChild
nameNode = penNode.firstChild
display =nameNode.firstChild.nodeValue;
document.show.me.value=display
}
</script>
</head>
<body>
<span ID="blueBack">Read firstChild</span>
<div>
<form name="show">
<input type=text name="me">
<input type="button" value="Display Writer"
onClick="findWriter()">
</form>
</div>
</body>
</html>
writers.xml
<?xml version="1.0" ?>
<writers>
<EnglishLanguage>
<fiction>
<pen>
<name>Jane Austin</name>
<name>Rex Stout</name>
<name>Dashiell Hammett</name>
</pen>
</fiction>
</EnglishLanguage>
</writers>
Output:
Result: Thus, Simple application for accessing the data using xml is executed successfully.
Exp. No.: 11 XML – XSL Transformation Date :
Aim: To write a XSL program to transform a XML file into HTML using XSL
transformation.
Procedure:
1. Create an valid and well-formed XML document
2. Create an XSL document which will use XPATH expression to traverse through the
3. The XSL document refers to the XSLT namepace in order to use the XPATH and xsl
constructs
4. The XSLT uses xsl:template is used to match to the root element of the xml and then
5. The data fetched from the XML is constructed as a table using HTML <table> tag.
Program:
Student.xml
<person-details>
<regno>32309205002</regno>
<name>Anand</name>
<address>K.K.Nagar</address>
<contactno>987664321</contactno>
<year>III</year>
<GPA>7.8</GPA>
</person-details>
<person-details>
<regno>32309205003</regno>
<name>Babu</name>
<address>K.K.Nagar</address>
<contactno>987664322</contactno>
<year>III</year>
<GPA>7.8</GPA>
</person-details>
<person-details>
<regno>32309205004</regno>
<name>Chandra</name>
<address>T.Nagar</address>
<contactno>968654321</contactno>
<year>III</year>
<GPA>7.9</GPA>
</person-details>
<person-details>
<regno>32309205005</regno>
<name>Madhavan</name>
<address>Valasi</address>
<contactno>987894321</contactno>
<year>III</year>
<GPA>8.0</GPA>
</person-details>
<person-details>
<regno>32309205006</regno>
<name>Vikram</name>
<address>Porur</address>
<contactno>987654221</contactno>
<year>III</year>
<GPA>8.5</GPA>
</person-details>
<person-details>
<regno>32309205007</regno>
<name>Bharathi</name>
<address>Valasaravakkam</address>
<contactno>988454321</contactno>
<year>III</year>
<GPA>7.8</GPA>
</person-details>
</Students>
Student.xsl
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Student details</h2>
<table border="1">
<trbgcolor="gray">
<th>Regno</th>
<th>Name</th>
<th>Address</th>
<th>Contact no</th>
<th>Year</th>
<th>GPA</th>
</tr>
<xsl:for-each select="Students/person-details">
<trbgcolor="pink">
<td><xsl:value-of select ="regno"/></td>
<td><xsl:value-of select ="name"/></td>
<td><xsl:value-of select ="address"/></td>
<td><xsl:value-of select ="contactno"/></td>
<td><xsl:value-of select ="year"/></td>
<td><xsl:value-of select ="GPA"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Output:
Result: Thus an XSL program is written to transform a XML document into HTML using
XSLT.
Exp. No.: 12 Factorial Web Service Date :
Aim: To create Factorial Web service using J2EE and consuming it using J2EE Client.
Procedure:
Step 1: Creating Web Application
1. Go to File Menu ->New Project->Choose Java Web->Select Web Application
(Choose Project)
2. Click Next
3. Specify Project Name as FactorialServer (Name and Location)
4. Click Next
5. Click Next (Server and Settings)
6. Click Finish (Frameworks)
7. Now the Web Application FactorialServer is created.
@WebService()
public class Factorial {
/*Web service operation */
@WebMethod(operationName = "findFactorial")
public long findFactorial(@WebParam(name =
"n") int n) {
long fact=1;
for(inti=1;i<=n;i++)
fact=fact*i;
return fact;
}
}