<!DOCTYPE html>
<html lang="en-US">
<body>
<h1>CSS opacity Property</h1>
<p>This is a paragraph.</p>
<button onclick="myFunction()">Click Me</button>
<script>
var x = document.getElementsByTagName("p")[0];
function myFunction(){
x.style.opacity = "0.5";
}
</script>
<p><strong>Note</strong>: Click on the button to reduce the opacity of the paragraph to 0.5.</p> </body>
</html>