जावास्क्रिप्ट में बैकग्राउंड इमेज का पोजिशनिंग एरिया सेट करने के लिए, backgroundOrigin प्रॉपर्टी का उपयोग करें।
उदाहरण
बैकग्राउंड के लिए इमेज का पोजिशनिंग एरिया सेट करना सीखने के लिए निम्न कोड चलाकर देखें:
<!DOCTYPE html> <html> <head> <style> #box { border: 2px dashed yellow; padding: 35px; width: 600px; height: 400px; background: url('https://www.tutorialspoint.com/videotutorials/images/coding_ground_home.jpg') no-repeat; } </style> </head> <body> <button onclick="display()">बैकग्राउंड इमेज का एरिया सेट करें</button> <div id="box"> यह डेमो टेक्स्ट है! यह डेमो टेक्स्ट है! यह डेमो टेक्स्ट है! यह डेमो टेक्स्ट है! यह डेमो टेक्स्ट है! </div> <script> function display() { document.getElementById("box").style.backgroundOrigin = "content-box"; } </script> </body> </html>