Saturday, September 24, 2016

HTML- Image

<html>
<body>

<img src="E://fantastic/funny_apple.jpg" width="1200" height="1000">
</body>
</html>

HTML- Link

<html>
<body>

<a href="http://www.google.com">
This is a link</a>

</body>
</html>

HTML-Frames

<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>HTML FRAMES</TITLE>
</HEAD>
<FRAMESET cols="33%, 33%, 34%" frameborder="1">
<FRAME NAME="TOP" SRC="E://Siddhant/HTML/Google/login1.html" noresize="noresize"/>
<FRAME NAME="MAIN" SRC="file:///E:/Siddhant/HTML/GOOGLE/search.html" noresize="noresize"/>
<FRAME NAME="BOTTOM" SRC="file:///E:/Siddhant/HTML/GOOGLE/signup.html" noresize="noresize"/>
<NOFRAMES>
<BODY>
YOUR BROWSER DOES NOT SUPPORT FRAMES.
</BODY>
</NOFRAMES>
</FRAMESET>
</HTML>

HTML- Forms

<html>
<body>

<form action="">
First name: <input type="text" name="firstname"><br>
Last name: <input type="text" name="lastname">
</form>

<p><b>Note:</b> The form itself is not visible. Also note that the default width of a text field is 20 characters.</p>

</body>
</html>

HTML- Change Text

<!DOCTYPE html>
<html>
<body>

<h1>What Can JavaScript Do?</h1>

<p id="demo">JavaScript can change HTML content.</p>

<button type="button"
onclick="document.getElementById('demo').innerHTML = 'Hello JavaScript!'">
Click Me!</button>

</body>
</html>

HTML- Change Text Format

<!DOCTYPE html>
<html>
<body>

<h1>What Can JavaScript Do?</h1>

<p id="demo">JavaScript can change the style of an HTML element.</p>

<script>
function myFunction() {
    var x = document.getElementById("demo");
    x.style.fontSize = "25px";          
    x.style.color = "red";
}
</script>

<button type="button" onclick="myFunction()">Click Me!</button>

</body>
</html>

HTML- Change Image on Mouse Click

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Can Change Images</h1>

<img id="myImage" onclick="changeImage()" src="pic_bulboff.gif" width="100" height="180">

<p>Click the light bulb to turn on/off the light.</p>

<script>
function changeImage() {
    var image = document.getElementById('myImage');
    if (image.src.match("bulbon")) {
        image.src = "pic_bulboff.gif";
    } else {
        image.src = "pic_bulbon.gif";
    }
}
</script>

</body>
</html>