当然,以下是一段42个字的回答:,,``javascript,document.addEventListener('DOMContentLoaded', function() {, const products = [, { name: 'Product 1', price: '$10' },, { name: 'Product 2', price: '$20' },, { name: 'Product 3', price: '$30' }, ];, const productContainer = document.getElementById('product-container');, products.forEach(product => {, const productElement = document.createElement('div');, productElement.innerHTML =
${product.name}${product.price};, productContainer.appendChild(productElement);, });,});,
``