বক্সে ড্রপ শ্যাডো যোগ করতে জাভাস্ক্রিপ্টে boxShadow প্রপার্টি ব্যবহার করা হয়। এই প্রপার্টি দিয়ে শ্যাডোর প্রস্থ এবং রঙ যোগ করা যায়।
উদাহরণ
<!DOCTYPE html> <html> <head> <style> #box { border: thick solid green; width: 300px; height: 200px } </style> </head> <body> <div id="box">Demo Text</div> <br><br> <button type="button" onclick="display()">Add drop shadow</button> <script> function display() { document.getElementById("box").style.boxShadow = "20px 15px 25px orange"; } </script> </body> </html>