HTML
<!DOCTYPE html>
<html>
<head>
<link href = "calculator.css" rel = "stylesheet" type = "text/css">
<title>
Calculator
</title>
</head>
<body id = "body">
<p id = "p1"> hi there this is some sort of paragraph</p>
<script src = "calculator.js" type = "text/javascript">
</script>
</body>
</html>
JAVASCRIPT CODE
var p1 = document.getElementById("p1");
p1.style.background = "green";
here, I tried giving the p1 paragraph to just check out whether my file was linked to the HTML file here i set the style property of the p1 paragraph to green but instead it did not change. please tell me why.
and one thing more -
how to use the hypen properties of css? for example the background-color property how to access it with javascript?