Total Pageviews

Copyright By Web Designing & SEO blog. Powered by Blogger.

Translate

Labels

Blog Archive

More Results

Showing posts with label javascript. Show all posts

change image size using javascript

Change any image size with the using of  Radio Button in javascript | Change any image size using javascript



Change image size using javascript

Change image size using js




Hello, friends this javascript code is very easy to understand.
First Open any Text Editor.
Type below code or copy & paste into Editor.
Now, Save the file as .html extension.

Code is given below:

<html>
<head>
<script language="javascript">

function f2()
{
document.getElementById('i1').height=400;
document.getElementById('i1').width=500;
}
function f3()
{
document.getElementById('i1').height=600;
document.getElementById('i1').width=700;
}
function f4()
{
document.getElementById('i1').height=800;
document.getElementById('i1').width=900;
}
function fo()
{
document.getElementById('i1').height=200;
document.getElementById('i1').width=300;
}

</script>
</head>
<body>
<form name="f1">

<input type="radio" name="r1" onClick="fo()">200 X 300
<input type="radio" name="r1" onClick="f2()">400 X 500
<input type="radio" name="r1" onClick="f3()">600 X 700
<input type="radio" name="r1" onClick="f4()">800 X 900
<img id="i1" name="img1" src="gun.jpg" height=150 width=250>
</form>
</body>
</html>


See the Output
Tag : ,

Enable and disable drop down list in javascript

Enable and Disable Two Select box Using Radio Button


Enable and disable drop down list in javascript



Simply Write Below code in Text editor (ANY Notepad , Dreamweaver , Notepad ++ ).

Code is as Below:

<html>
<body onLoad="cLoad()">
<script language="javascript">
function c1()
{
f1.s1.disabled=false;
f1.s2.disabled=true;
}
function c2()
{
f1.s1.disabled=true;
f1.s2.disabled=false;
}
function cLoad()
{
f1.g1[0].checked="unchecked";
f1.s2.disabled=true;
}
</script>
<fieldset style="width:180px;">

<form name="f1">
<legend>
<input type="radio" name="g1" onClick="c1()">Food
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="g1" onClick="c2()">Drinks
<br><br>
<select name="s1">
<option>Vadapav</option>
<option>Dabeli</option>
<option>Bhajipav</option>
<option>Gathiya</option>
<option>Khaman</option>
</select>
<select name="s2">
<option>Sprite</option>
<option>Mazza</option>
<option>Slice</option>
<option>Thums up</option>
<option>Fanta</option>
</select>
</legend>
</form>
</fieldset>
</body>
</html>


Output is Like this :

Food        Drinks

Tag : ,

Change background color using javascript

Change background color using javascript . It is very easy and simple coding.
Simply write this code in to Text Editor(Notepad) and SAVE the document as .html extension.
And change the background color of your document. It is very helpful for Website.

<html>
<head>
<script language="javascript">
function bgclr()
{
document.bgColor=f1.t1.value;
}
</script>
</head>

<body>
<form name="f1">
Color : <input type="text" name="t1" onkeyup="bgclr()">
</form>
</body>

Like This :
Change-background-color-using-javascript



Tag : ,

Change Case through JS | javascript

Change case (uppercase,lowercase etc..) with the simplest use of javascript


Write this Code in Text Editor (Any, Notepad , Notepad ++ , Dreamweaver)


<html>
<head>
<script language="javascript">
function c1(c)
{
j1.style.textTransform=c
}
</script>
</head>
<body>
<form name="f1">
<input type="radio" name="g1" onClick="c1('uppercase')"> UPPERCASE
<input type="radio" name="g1" onClick="c1('lowercase')"> lowercase
<input type="radio" name="g1" onClick="c1('capitalize')"> Capitalize
<input type="radio" name="g1" onClick="c1('none')"> normal
</form>
<h1 id="j1">change the case</h1>
</body>
</html>

Now, SAVE this document as .html Extension.



Tag : ,

- Copyright © Web Designing & SEO Blog - Web Designing and SEO Blog