JavaScript Program of KeyUp to Increase Width With Validation


Javascript KeyUP

JavaScript Program of KeyUp to Increase Width With ValidationJavascript KeyUP

<!doctype html>
<html>
<head>
<meta charset=”utf-8″>
<title>Untitled Document</title>
<style>
#s1{width:0px;
height:50px;
background-color:red;
}
</style>
</head>

<body>
<input type=”text” id=”ss” onKeyUp=”sanjay()”>

<div id=”s1″></div>
<script>
a=0;
function sanjay()
{
gg=document.getElementById(“ss”).value;
bb=gg.length;
a=bb*20;
aa=document.getElementById(“s1″);
aa.style.width=a+”px”;
if(bb>=8)
{
aa.style.backgroundColor=”green”;
}
else
{
aa.style.backgroundColor=”red”;
}
}
</script>
</body>
</html>

 

 

I am a graphic and web designer in Delhi and Professional Web and Graphics Designer & Animator. I provide SEO Service in Delhi along with SEO, Web and Graphics Designing Courses training with latest technique.