অস্বচ্ছতা ব্যবহার করুন৷ অস্বচ্ছতা স্তর সেট করতে জাভাস্ক্রিপ্টে সম্পত্তি। আপনি JavaScript-
-এর সাথে একটি উপাদানের জন্য অস্বচ্ছতা স্তর সেট করতে নিম্নলিখিত কোড চালানোর চেষ্টা করতে পারেনউদাহরণ
<!DOCTYPE html>
<html>
<head>
<style>
#box {
width: 450px;
background-color: gray;
}
</style>
</head>
<body>
<p>Click below to set Opacity.</p>
<button type="button" onclick="display()">Set Opacity</button>
<div id="box">
<p>This is a div. This is a div. This is a div. This is a div. This is a div.</p>
<p>This is a div. This is a div. This is a div. This is a div. This is a div.</p>
<p>This is a div. This is a div. This is a div. This is a div. This is a div.</p>
</div>
<br>
<script>
function display() {
document.getElementById("box").style.opacity = "0.5";
}
</script>
</body>
</html>