function effect()
{
var x = document.getElementById("para1");
x.style.backgroundColor="yellow";
}
function effectback()
{
var x = document.getElementById("para1");
x.style.backgroundColor="white";
}
function effect2()
{
var x = document.getElementById("para2");
x.style.color = "yellow";
}
function effect2back()
{
var x = document.getElementById("para2");
x.style.color = "black";
}
function idm()
{
var x = document.getElementById("name");
x.style.color = "yellow";
}
function dimb()
{
var x = document.getElementById("name");
x.style.color = "black";
}
function city()
{
var x = document.getElementsByTagName("input");
alert(x.innerHTML);
x.style.color = "yellow";
}
function cityreturn()
{
var x = document.getElementsByTagName("input");
x.style.color = "black";
}
{
var x = document.getElementById("para1");
x.style.backgroundColor="yellow";
}
function effectback()
{
var x = document.getElementById("para1");
x.style.backgroundColor="white";
}
function effect2()
{
var x = document.getElementById("para2");
x.style.color = "yellow";
}
function effect2back()
{
var x = document.getElementById("para2");
x.style.color = "black";
}
function idm()
{
var x = document.getElementById("name");
x.style.color = "yellow";
}
function dimb()
{
var x = document.getElementById("name");
x.style.color = "black";
}
function city()
{
var x = document.getElementsByTagName("input");
alert(x.innerHTML);
x.style.color = "yellow";
}
function cityreturn()
{
var x = document.getElementsByTagName("input");
x.style.color = "black";
}
===================================================
document.write("<h1 style='background-color:yellow;color:red'>Welcome to External Java Script..!</h1>");
document.write("</br>");
document.write("thank You");
var str ="Amit Manjhi";
document.write("the string is "+str+"</br>");
var a = 10;
document.write("Int val :"+a);
function validate()
{
alert("Inside validate");
}
function myreturn()
{
return("Hello >>>>>>>>>>>>> I am return value");
}
function sum(a,b)
{
return(a+b);
}
function red()
{
document.bgColor = "red";
}
function green()
{
document.bgColor = "green";
}
function yellow()
{
document.bgColor='yellow';
}
function blue()
{
document.bgColor='blue';
}
===================================================================
function validate()
{ alert("inside 1");
var result = true;
var i = document.getElementsByTagName("input");
if(i[0].value.length==0)
result = false;
return (result);
}
function validateEmail()
{
var result = true;
var e = document.getElementsByName("email")[0].value; // [0] means first email (if there are multiple emails)
//alert(e);
var atindex = e.indexOf('@');
//alert(atindex);
var dotindex = e.lastIndexOf('.');
//alert(dotindex);
if(atindex<1 || dotindex >= e.length-2 || dotindex - atindex <3)
result = false;
return (result);
}
===================================================================