Page 106 - COPA VOL II of II - TP -Punjabi
P. 106
document.getElementById(“demo”).innerHTML = ਆਉਟਪੁੱਟ
“A2”;
} else if (x>70 && x <= 80) {
document.getElementById(“demo”).innerHTML =
“A3”;
}
}
</script>
</body>
</html>
ਟਾਸਕ 4 : DHTML ਭਵੱਚ JavaScript ਦੇ ਿਾਲ CS
var element = document.get ElementById
ਰੈਫ ਸਟੈਪ 1 ਤੋਂ 16 - ਟਾਸਕ 1
(‘demo’).style.color = newColor;
<html>
}
<head>
</script>
<title>
</body>
getElementById.style.property example
</html>
</title>
ਆਉਟਪੁੱਟ
</head>
<body>
<p id=”demo”> This text changes color when click
on the following different buttons. </p>
<button onclick=”change_Color(‘green’);”> Green </
button>
<button onclick=”change_Color(‘blue’);”> Blue </
button>
<script type=”text/javascript”>
function change_Color(newColor) {
ਟਾਸਕ 5 : DHTML CSS
ਰੈਫ ਸਟੈਪ 1 ਤੋਂ 16 - ਟਾਸਕ 1<html> Changes current HTML element
<head> </title>
<title> </head>
92 IIT ਅਤੇ ITES : COPA (NSQF - ਸੰਸ਼ੋਭਿਤ 2022) - ਅਭਿਆਸ 1.32.120