JS DOM programs collection
JS program to show the concept of getElementById(DOM)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>background change</title>
</head>
<body>
<button onclick="colorChange();">click to change the background</button>
<script>
function colorChange()
{
document.body.style.backgroundColor="orange";
}
</script>
</body>
</html>
No comments:
Post a Comment