জাভাস্ক্রিপ্ট getComputedStyle
🌈জাভাস্ক্রিপ্ট getComputedStyle কি?
📋জাভাস্ক্রিপ্ট getComputedStyle হলো এলিমেন্টের কার্যকর স্টাইলের তথ্য বের করার পদ্ধতি।
⚒️জাভাস্ক্রিপ্ট getComputedStyle এলিমেন্টের কার্যকর স্টাইলের তথ্য বের করতে ব্যবহৃত হয়।
জাভাস্ক্রিপ্ট getComputedStyle এলিমেন্টের কার্যকর স্টাইলের তথ্য বের করার উদাহরণ।
javascript
<!DOCTYPE html>
<html>
<body>
<p id="text" style="font-size:24px">প্রোগ্রামিং শিখুন</p>
<button onclick="showStyle()">স্টাইল</button>
<p id="result"></p>
<script>
function showStyle() {
let style = window.getComputedStyle(text);
result.textContent = style.fontSize;
}
</script>
</body>
</html>