To create an html file to implement the concept of document object model using javascript.

Document Object Model



Source Code:

<!DOCTYPE html>
<html>
<body>
<p id="demo">Click the button to display the cookies associated with this document.</p>
<button onclick="myFunction()">Try it</button>
<hr>
    <a href="mailto:sanjam531@gmail.com">Sanjampreet Singh</a>
    <br>
    <a href="http://sanjamhelping.blogspot.in/p/it-14304-it-methodologies-lab.html">Department Of Information Technology</a>
    <br>
    <a href="E:\documents\IM LAB\html\js2\js2.html">Next Practical-></a>
<script>
function myFunction()
{
document.getElementById("demo").innerHTML="Cookies associated with this document : " + document.cookie;
}
</script>
</body>
</html>

Output:


LaTeX Source:

\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{multicol}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{transparent}
\usepackage{multirow}
\usepackage{eso-pic}
\usepackage[utf8]{inputenc}
\usepackage{color}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\BackgroundIm{
\put(0,0){
\parbox[b][\paperheight]{\paperwidth}{
\vfill
\centering
{\transparent{0.05} \includegraphics[height=\paperheight,width=\paperwidth,
keepaspectratio]{gne}
\vfill
}}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\AddToShipoutPicture{\BackgroundIm}
\newpage
\section{\emph{To create an html file to implement the concept of document object model using javascript.}}
\subsection{\emph{Source Code:}}
\begin{verbatim}
<!DOCTYPE html>
<html>
<body>
<p id="demo">Click the button to display the cookies associated with this document.</p>
<button onclick="myFunction()">Try it</button>
<hr>
<a href="mailto:sanjam531@gmail.com">Sanjampreet Singh</a>
<br>
<a href="http://sanjamhelping.blogspot.in/p/it-14304-it-methodologies-lab.html">Department Of Information Technology</a>
<br>
<a href="E:\documents\IM LAB\html\js2\js2.html">Next Practical-></a>
<script>
function myFunction()
{
document.getElementById("demo").innerHTML="Cookies associated with this document : " + document.cookie;
}
</script>
</body>
</html>
\end{verbatim}
\subsubsection{\emph{Output:}}
\begin{figure}[h]
\centering
\includegraphics[scale=0.5]{js1}
\caption{Output Of HTML page with Js}
\end{figure}
\end{document}

Output:


Comments

Popular posts from this blog

Program to illustrate the concept of templates.

To create an html file to implement the concept of margin, padding using cascading style sheets.

To configure the IP address for a computer connected to LAN