Sunteți pe pagina 1din 22

1.

HTML Basics
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>HTML Basics</title> </head> <body> <!-- This is a Comment --> <h1>This is a heading 1</h1> <h2>This is a heading 2</h2> <h3>This is a heading 3</h3> <h4>This is a heading 4</h4> <h5>This is a heading 5</h5> <h6>This is a heading 6</h6> <p>This is a paragraph.</p> <p>This is another paragraph.</p> <p><a href="http://www.google.com">Click here</a> to go to googles homepage</p>

<img src="logo.jpg" alt=MITS width="142" height="132">

</body> </html>

Output of HTML Basics

2.HTML Text Formatting


<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>HTML Text Formatting</title> </head> <body> <h3>HTML Text Formatting Tags</h3> <p><b>Defines bold text</b></p> <p><em>Defines emphasized text</em></p> <p><i>Defines a part of text in an alternate voice or mood</i></p>

<p><small>Defines smaller text</small></p> <p><strong>Defines important text</strong></p> <p><sub>Defines subscripted text</sub></p> <p><sup>Defines superscripted text</sup></p> <p><ins>Defines inserted text</ins></p> <p><del>DefinesDeleted text</del></p> <hr /> <h3>HTML "Computer Output" Tags</h3> <code>Defines computer code text</code> <kbd>Defines keyboard text </kbd> <samp>Defines sample computer code</samp> <var>Defines a variable</var> <pre>Defines preformatted text</pre> <hr /> <h3>HTML Citations, Quotations, andDefinition Tags</h3> <abbr>Defines an abbreviation or acronym</abbr> <address>Defines contact information for the author/owner of aDocument</address> <bdo>Defines the textDirection</bdo> <blockquote>Defines a section that is quoted from another source</blockquote> <q>Defines an inline (short) quotation</q> <cite>Defines the title of a work</cite> <dfn>Defines aDefinition term</dfn> </body> </html>

Output of HTML Text Formatting

3. HTML Tables
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>BCA Final Year time Table using HTML table</title> </head> <body> <table border="2" cellspacing="5" cellpadding="10" width="733"> <tr> <td colspan="8"><h1>BCA Final Year Time Table</h1></td> </tr> <tr> <td width="92"><p align="center">Day/Time</p></td> <td width="92"><p align="center">10:30 11:30</p></td> <td width="92"><p align="center">11:30 12:30</p></td> <td width="92"><p align="center">12:30 01:30</p></td> <td width="92"><p align="center">01:30 02:30</p></td> <td width="92"><p align="center">02:30 03:20</p></td>

<td width="92"><p align="center">03:20 04:10</p></td> <td width="92"><p align="center">04:10 05:00</p></td> </tr> <tr> <td width="92"><p align="center">Mon</p></td> <td width="92"><p align="center">OR (BA)</p></td> <td width="92"><p align="center">SE (PSK)</p></td> <td width="92"><p align="center">CN(SP)</p></td> <td width="92" rowspan="6"><p><strong>LUNCH</strong></p></td> <td width="92"><p align="center">SE (PSK)</p></td> <td width="92"><p align="center">COAS(TO)</p></td> <td width="92"><p align="center">LIBRARY</p></td> </tr> <tr> <td width="92"><p align="center">Tue</p></td> <td width="92"><p align="center">SE (PSK)</p></td> <td width="92"><p align="center">OR (BA)</p></td> <td width="92"><p align="center">CN(SP)</p></td> <td width="92"><p align="center">COAS(TO)</p></td> <td width="183" colspan="2"><p align="center">PROJECT</p></td> </tr> <tr> <td width="92"><p align="center">Wed</p></td> <td width="92"><p align="center">CN(SP)</p></td> <td width="92"><p align="center">COAS(TO)</p></td> <td width="92"><p align="center">OR (BA)</p></td> <td width="275" colspan="3"><p align="center">IWT LAB (BR)(LAB 3)</p></td> </tr>

<tr> <td width="92"><p align="center">Thu</p></td> <td width="92"><p align="center">COAS(TO)</p></td> <td width="92"><p align="center">SE (PSK)</p></td> <td width="92"><p align="center">OR (BA)</p></td> <td width="275" colspan="3"><p align="center">JAVA LAB (RRD)(LAB 3)</p></td> </tr> <tr> <td width="92"><p align="center">Fri</p></td> <td width="92"><p align="center">CN(SP)</p></td> <td width="92"><p align="center">SE (PSK)</p></td> <td width="92"><p align="center">LIBRARY</p></td> <td width="275" colspan="3"><p align="center">JAVA LAB (RRD)(LAB 3)</p></td> </tr> <tr> <td width="92"><p align="center">Sat</p></td> <td width="92"><p align="center">COAS(TO)</p></td> <td width="92"><p align="center">OR (BA)</p></td> <td width="92"><p align="center">CN(SP)</p></td> <td width="275" colspan="3"><p align="center">IWT LAB (BR)(LAB 3)</p></td> </tr> </table> </body> </html>

OUTPUT of HTML Tables

4.HTML Forms
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>HTML Form Example</title> </head> <body> <form name="register" method="post" action="#"> <fieldset> <legend>Personal information:</legend> <table> <tr><td width="200">Your Name :</td> <td width="400"><input type="text" name="Name" size="30" /></td> </tr> <tr> <td width="200">Gender :</td> <td width="400"><input type="radio" name="sex" value="male">Male<br> <input type="radio" name="sex" value="female">Female</td> </tr> <tr>

<td width="200">Date of Birth :<br /><font color="#999999" size="1">DD/MM/YYYY</font></td> <td width="400"><input type="text" name="DOB" value="" size="30" /></td> </tr> <tr> <td width="200">Mobile Number :</td> <td width="400"><input type="text" name="Mobile" value="" size="30" /></td> </tr> <tr> <td width="200">Address :</td> <td width="400"><textarea cols="40" rows="5"></textarea></td> </tr> <tr> <td width="200">Choose a course :</td> <td width="400"> <select name="course"> <option value="">Please select a course</option> <option value="B.Tech">B.Tech</option> <option value="M.Tech">M.Tech</option> <option value="BCA">BCA</option> </select> </td> </tr> <tr> <td width="200">Upload your photo :</td> <td width="400"><input type="file" name="photo" size="30" /></td> </tr>

<tr> <td colspan="2"><input type="checkbox" name="accept" /> This is check box</td> </tr> <tr><td colspan="2" align="center"><input type="submit" /></td></tr> </table> </fieldset></form> </body> </html> OUTPUT Of HTML Forms

5.HTML Frameset
<html>

<frameset rows="50%,50%"> <frame src="frame_a.htm"> <frameset cols="25%,75%"> <frame src="frame_b.htm"> <frame src="frame_c.htm"> </frameset> </frameset>

</html>

OUTPUT OF HTML FRAMESET

6. JavaScript Introduction
<html> <head> <title>Javascript Basic</title> </head> <body> <script type="text/javascript"> // Write a heading document.write("<h1>This is a heading</h1>"); // Write two paragraphs: document.write("<p>This is a paragraph.</p>"); document.write("<p>This is another paragraph.</p>"); </script> </body> </html>

OUTPUT of Javascript introduction

7.Javascript Variables
<html> <head> <title>Javascript Basic</title> </head> <body> <script type="text/javascript"> var firstname; firstname="MITS"; document.write(firstname); document.write("<br />"); firstname="Rayagada"; document.write(firstname); </script> <p>The script above declares a variable, assigns a value to it, displays the value, changes the value,and displays the value again.</p>

</body> </html>

Output of Javascript variables

8.Javascript Operators
<html> <head> <title>Javascript Basic</title> </head> <body> <script type="text/javascript"> x=5+5; document.write(x); document.write("<br />"); x="5"+"5"; document.write(x); document.write("<br />"); x=5+"5"; document.write(x); document.write("<br />"); x="5"+5; document.write(x); document.write("<br />"); </script> <p>The rule is: If you add a number and a string, the result will be a string.</p> </body> </html>

OUPUT Of Javascript Operators

9.Javascript Loops
<html> <head> <title>Javascript Basic</title> </head> <body> <script type="text/javascript"> for (i = 0; i <= 5; i++) { document.write("The number is " + i); document.write("<br />"); } </script> <p>Explanation:</p> <p>This for loop starts with i=0.</p> <p>As long as <b>i</b> is less than, or equal to 5, the loop will continue to run.</p> <p><b>i</b> will increase by 1 each time the loop runs.</p> <script type="text/javascript"> i=0; while (i<=5) { document.write("The number is " + i); document.write("<br />"); i++; } </script>

<p>Explanation:</p> <p><b>i</b> is equal to 0.</p> <p>While <b>i</b> is less than, or equal to, 5, the loop will continue to run.</p> <p><b>i</b> will increase by 1 each time the loop runs.</p> <script type="text/javascript"> i = 0; do { document.write("The number is " + i); document.write("<br />"); i++; } while (i <= 5) </script> <p>Explanation:</p> <p><b>i</b> equal to 0.</p> <p>The loop will run</p> <p><b>i</b> will increase by 1 each time the loop runs.</p> <p>While <b>i</b> is less than, or equal to, 5, the loop will continue to run.</p> </body> </html>

OUTPUT of Javascript Loops

10.Javascript Functions
<html> <head> <title>Javascript Basic</title> </head> <body> <script type="text/javascript"> function displaymessage() { alert("Hello World!"); } </script> </head> <body> <form> <input type="button" value="Click me!" onclick="displaymessage()" /> </form> <p>By pressing the button above, a function will be called. The function will alert a message.</p> </body> </html>

OutPut of Javascript Functions

S-ar putea să vă placă și