document.addEventListener('DOMContentLoaded', function () { // Create container div const container = document.createElement('div'); container.className = 'search-container'; container.innerHTML = ` `; // Append to a specific location on the product page // Example: above the product title const productTitle = document.querySelector('.product-title, h1.product-title'); // update selector as needed if (productTitle && productTitle.parentNode) { productTitle.parentNode.insertBefore(container, productTitle); } // Add CSS styles dynamically const style = document.createElement('style'); style.innerHTML = ` .search-container { position: relative; margin-top: 20px; } .search-container input[type="search"] { padding-left: 2.5rem; } .search-container .fa-search { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); color: #aaa; pointer-events: none; } `; document.head.appendChild(style); });
products-banner
FILTER BY
NEWEST FIRST