hi every one today i am going to start session 8 .
let us see more exmple to know detail connectivity of html & javascript
let see another example
in above example checking how current date is cheking for entered date if match then show certain result otherwise go to else condition it show message about try next time.
in below i use this script in which check if enter data is date below script get data from abc id tag & display result
thanks for watching...please dont forget to share ..
let us see more exmple to know detail connectivity of html & javascript
example 1:
<!DOCTYPE html>
<html>
<head>
<title>JavaScript & html connectivity</title>
<script type = "text/JavaScript">
function Hello() {
alert("Hello, MAYUR");
}
</script>
</head>
<body>
<input type = "button" onclick = "Hello();" name = "ok" value = "Click Me" />
</body>
</html>
above exmple is alert message when user click on button it shows message of hello mayur.<!DOCTYPE html>
<html>
<head>
<title>JavaScript & html connectivity</title>
<script type = "text/JavaScript">
function Hello() {
alert("Hello, MAYUR");
}
</script>
</head>
<body>
<input type = "button" onclick = "Hello();" name = "ok" value = "Click Me" />
</body>
</html>
let see another example
<!DOCTYPE html>
<html>
<body>
<p id="abc"></p>
<script>
var currentdate, somedate, output;
currentdate = new Date();
somedate = new Date();
someday.setFullYear(2018, 4, 18);
if somedate > currentdate) {
output = "Today is not may 18, 2018.";
} else {
output = "yes today is 18 may, 2018.";
alert('oops!! ok try again for next time');
}
document.getElementById("abc").innerHTML = output;
</script>
</body>
</html>
<html>
<body>
<p id="abc"></p>
<script>
var currentdate, somedate, output;
currentdate = new Date();
somedate = new Date();
someday.setFullYear(2018, 4, 18);
if somedate > currentdate) {
output = "Today is not may 18, 2018.";
} else {
output = "yes today is 18 may, 2018.";
alert('oops!! ok try again for next time');
}
document.getElementById("abc").innerHTML = output;
</script>
</body>
</html>
in above example checking how current date is cheking for entered date if match then show certain result otherwise go to else condition it show message about try next time.
in below i use this script in which check if enter data is date below script get data from abc id tag & display result
<script>
var date1 = new Date();
document.getElementById("abc").innerHTML = isDate(date1);
function isDate(date1) {
return date1.constructor.toString().indexOf("Date") > -1;
}
</script>
var date1 = new Date();
document.getElementById("abc").innerHTML = isDate(date1);
function isDate(date1) {
return date1.constructor.toString().indexOf("Date") > -1;
}
</script>
thanks for watching...please dont forget to share ..
THANK YOU FOR THE INFORMATION
ReplyDeletePLEASE VISIT US
Website Designing in Bangalore