Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts
javascript
Validation Form using Javascript
agyanadda
December 29, 2018
How to validation using java script
Login Form Validation
javascript
agyanadda
December 24, 2018
How to create addition, subtraction by using function and switch statement.
javascript
====================================================================
ASCII key code of F5 is: 116.
====================================================================
agyanadda
December 08, 2018
Click this page to set focus.
==================================================================== ====================================================================
javascript
function validateForm(){
var nm = document.forms["myForm"]["fname"].value;
var eml = document.forms["myForm"]["eml"].value;
var mob = document.forms["myForm"]["mob"].value;
var gen = document.forms["myForm"]["gen"].value;
var course = document.forms["myForm"]["chk"].value;
var country = document.forms["myForm"]["country"].value;
var city = document.forms["myForm"]["city"].value;
var addr = document.forms["myForm"]["address"].value;
/*-------[myultiple checkbox]----------------*/
var checkBoxes = document.getElementsByTagName('input');
// alert(checkBoxes.length);
var param = "Values of Checkboxes:"+"\n";
for (var i=0;i< checkBoxes.length;i++) {
if (checkBoxes[i].checked == true) {
param += checkBoxes[i].value + "\n";
}
}
alert(param);
}
Output
agyanadda
October 04, 2018
Output
javascript
<!DOCTYPE html>
<html>
<head>
<title>JavaScript Play video Example</title>
</head>
<body>
<div style="margin:auto;width: 30%;text-align: center;">
<button type="button" onclick="playpause()">Play/Pause</button>
<button type="button" onclick="big()">Big</button>
<button type="button" onclick="small()">Small</button>
<button type="button" onclick="normal()">Normal</button><br>
<video width="400" id="myvideo">
<source src="video.mp4" type="video/mp4">
</video>
</div>
<Script>
var mv=document.getElementById("myvideo");
function playpause(){
if(mv.paused)
mv.play();
else{
mv.pause();
}
}
function big(){
mv.width=500;
mv.hight=500;
}
function small(){
mv.width=200;
mv.hight=200;
}
function normal(){
mv.width=400;
mv.hight=400;
}
</Script>
</body>
</html>
agyanadda
September 18, 2018
<html>
<head>
<title>JavaScript Play video Example</title>
</head>
<body>
<div style="margin:auto;width: 30%;text-align: center;">
<button type="button" onclick="playpause()">Play/Pause</button>
<button type="button" onclick="big()">Big</button>
<button type="button" onclick="small()">Small</button>
<button type="button" onclick="normal()">Normal</button><br>
<video width="400" id="myvideo">
<source src="video.mp4" type="video/mp4">
</video>
</div>
<Script>
var mv=document.getElementById("myvideo");
function playpause(){
if(mv.paused)
mv.play();
else{
mv.pause();
}
}
function big(){
mv.width=500;
mv.hight=500;
}
function small(){
mv.width=200;
mv.hight=200;
}
function normal(){
mv.width=400;
mv.hight=400;
}
</Script>
</body>
</html>
Subscribe to:
Posts (Atom)