Friday, 21 December 2012

assignments in recursion

1)write a C program to find the sum of the 'N' numbers using Recursion?
2)Write a C program to find the reverse of a number using Recursion?
output: Enter a number 123
Reverse of a number 321
3)Write a C program to find the binary of a given integer
number using recursion?

onchange event and onmouseover event

<HTML> <HEAD> <SCRIPT LANGUAGE="JavaScript"> function cimage() { var iname=document.getElementById("simage").value; var ifile=iname+".jpg"; document.getElementById("myimg").src=ifile; } function rollimage() { document.getElementById("myimg").src="Winter.jpg"; } </SCRIPT> </HEAD> <BODY> <center> <SELECT ID="simage" onchange="cimage();"> <OPTION VALUE="Blue_hills">Blue hills</OPTION> <OPTION VALUE="Sunset">Sunset</OPTION> <OPTION VALUE="Water_lilies">Water lilies</OPTION> <OPTION VALUE="Winter">Winter</OPTION> </SELECT> <img height="200" id="myimg" onmouseover="rollimage();" src="Blue_hills.jpg" width="200"/> </center> </BODY> </HTML>

onblur event

<HTML> <HEAD> <SCRIPT LANGUAGE="JavaScript"> function checkSize() { var myname= document.getElementById("tname").value; if(myname.length < 6) { alert("Name should be atleast 6 characters"); } } </SCRIPT> </HEAD> <BODY> <FORM METHOD=POST ACTION=""> Enter your Name:<INPUT TYPE="text" id="tname" onblur="checkSize();"/> <br> Age:<INPUT TYPE="text" id="tage"/> </FORM> </BODY> </HTML>

Photo Album example using arrays in javascript

<HTML> <HEAD> <SCRIPT LANGUAGE="JavaScript"> var iarray=new Array("Desert.jpg","Hydrangeas.jpg","Jellyfish.jpg", "Lighthouse.jpg","Sunset.jpg","Winter.jpg"); var current=0; function next() { if(current == (iarray.length -1)) current=0; else current++; document.getElementById("photo").src=iarray[current]; } function previous() { if(current == 0) current=iarray.length -1; else current--; document.getElementById("photo").src=iarray[current]; } </SCRIPT> </HEAD> <BODY> <center> <img height="300" id="photo" src="Desert.jpg" width="300"/></br></br> <hr> <INPUT TYPE="button" VALUE="Previous" ONCLICK="previous();"> <INPUT TYPE="button" VALUE="Next" ONCLICK="next();"> </center> </BODY> </HTML>

Friday, 23 November 2012

frameset and iframe example

-------------- frameset------------------------------------- <FRAMESET cols="20,80" border="0"> <FRAME SRC="Mypage.html" ></FRAME> <FRAME SRC="page1.html" NAME="kmit"></FRAME> </FRAMESET> -----------------------Mypage.html------------------------------------- <HTML> <HEAD> <TITLE> menu</TITLE> </HEAD> <BODY > <h1>menu</h1> <a href="page1.html" target="kmit">AboutUs</a><br> <a href="page2.html" target="kmit">Home</a><br> <a href="page3.html" target="kmit">ContactUs</a><br> </BODY> </HTML> ------------------------page1.html------------------ <HTML> <HEAD> <TITLE>page1</TITLE> </HEAD> <BODY bgcolor=#00FFFF> <h1> About Us</h1> </BODY> </HTML> -------------------------page2.html------------ <HTML> <HEAD> <TITLE> page2</TITLE> </HEAD> <BODY bgcolor=#FFFF66> <h1> Home</h1> </BODY> </HTML> ------------------------page3.html--------------- <HTML> <HEAD> <TITLE>page3</TITLE> </HEAD> <BODY bgcolor=#99FF00> <h1> Contact Us</h1> </BODY> </HTML> -------------- iframe--------------------------- <HTML> <HEAD> <TITLE>iframe</TITLE> </HEAD> <BODY> <h1>Hi welcome to kmit</h1> <iframe src="page1.html" width="200" height="200" name="kmit">page1.html</iframe> <p> <a href="page2.html" target="kmit">page2.html</a></p> </BODY> </HTML> -----------------------------------------------------------

Thursday, 22 November 2012

image map example

<html> <head> <title>Imagemap</title> </head> <body> <div> <img alt="" src="india_map.jpg" style="border-style:none" usemap="#india_map" /> </div> <div> <map id="india_map" name="india_map"> <area shape="poly" alt="" coords="58,257,76,261,89,257,91,261,99,252,136,265,154,292,142,318,138,329,129,344,121,340,120,301,110,325,83,327,58,295,81,288" href="1.html" title="" /> </map> </div> </body> </html>

form controls in html

<HTML> <HEAD> <TITLE>KMIT FORM </TITLE> </HEAD> <BODY> <form id="myform" method="get" action=" "> <strong>FIRST NAME:</strong> <input type="text" id="fname" value="enter your first name"/><br> <strong>PASSWORD:</strong> <input type="password" id="pass"/><br> <input type="radio" name="sex" value="male">male</input><br> <input type="radio" name="sex" value="female">female</input><br> <INPUT TYPE="checkbox" NAME="reading" value="r">Reading</input><br> <INPUT TYPE="checkbox" NAME="writing" value="w">writing</input><br> <strong>address:</strong> <textarea id="address" rows="5" cols="10"></textarea><br> <strong>Branch</strong> <select id="branch"> <option id="cse">CSE</option> <option id="ece">ECE</option> <option id="eie">EIE</option> <option id="it" selected>IT</option> </select> <INPUT TYPE="submit" VALUE="submit"> <INPUT TYPE="reset" value="clear now"/> </form> </BODY> </HTML>

Wednesday, 10 October 2012

creating a Basic html5 Template


<!doctype html>
<html lang="en">
<head>
           <meta charset="utf-8"/>
           <title>fasi website</title>
           <link rel="stylesheet" href="main.css">
</head>
<body>
        <header>
               <h1>welcome to thenewboston</h1>
         </header>
           <nav>
                    <ul>
                  <li>Home</li>
                  <li>Tutorials</li>
                   <li>broadcast</li>
                    </ul>
          </nav>
           <section>
                       <article>
                                <header>
                                    <hgroup>
                                               <h1>title of article</h1>
                                               <h2>subtitle for article!</h2>
                                     </hgroup>
                                </header>
                                           <p>This is the best article eva !</p>
                                  <footer>
                                          <p> wtitten by fasi ahmed</p>
                                    </footer>
                     </article>
            </section>

          <aside><h4>news</h4>fasi has a new dog</aside>
         <footer> copyright thenewboston 2012</footer>
</body>
</html>