Page 105 - COPA VOL II of II - TP -Punjabi
P. 105
ਟਾਸਕ 2: JavaScript ਅਤੇ HTML ਇਵੈਂਟ
ਰੈਫ ਸਟੈਪ 1 ਤੋਂ 16 - ਟਾਸਕ 1 DHTML with JavaScript
<html> </title>
<head> <script type=”text/javascript”>
<title> function dateandtime()
alert(Date()); {
} ਆਉਟਪੁੱਟ
</script>
</head>
<body bgcolor=”orange”>
<font size=”4” color=”blue”>
<center> <p>
Click here # <a href=”#” onClick=”dateandtime();”>
Date and Time </a>
# to check the today’s date and time.
</p> </center>
</font>
</body>
</html>
ਟਾਸਕ 3 :JavaScript ਅਤੇ HTML DOM
ਰੈਫ ਸਟੈਪ 1 ਤੋਂ 16 - ਟਾਸਕ 1 </button>
<html> <p id=”demo”></p>
<head> <script type=”text/javascript”>
<title> Check Student Grade function checkGrade() {
</title> var x,p, text;
</head> p = document.getElementById(“percentage”).value;
<body> x=parseInt(p);
<p>Enter the percentage of a Student:</p> if (x>90 && x <= 100) {
<input type=”text” id=”percentage”> document.getElementById(“demo”).innerHTML =
<button type=”button” onclick=”checkGrade()”> “A1”;
Find Grade } else if (x>80 && x <= 90) {
IIT ਅਤੇ ITES : COPA (NSQF - ਸੰਸ਼ੋਭਿਤ 2022) - ਅਭਿਆਸ 1.32.120 91