var form=document.getElementsByClassName("search-form"); // document.getElementsByClassName("search-form")[1].setAttribute("action","https://cosmoshoponline.com/?post_type=product"); document.addEventListener("DOMContentLoaded", function() { console.log("hihjhhhhhhh"); // console.log(form[1]); // document.getElementsByClassName("search-form")[1].setAttribute("action","https://cosmoshoponline.com/?post_type=product") // Create a hidden input element var hiddenInput = document.createElement("input"); hiddenInput.setAttribute("type", "hidden"); hiddenInput.setAttribute("name", "post_type"); hiddenInput.setAttribute("value", "product"); // Append the hidden input to the form form[1].appendChild(hiddenInput); });
console.log("ihjiuhiuhi"); // Get all menu items that have submenus var menuItems = document.querySelectorAll('.wp-has-submenu'); console.log(menuItems); // Add hover events to show/hide submenu menuItems.forEach(function(menuItem) { // Show the submenu on mouse over menuItem.addEventListener('mouseenter', function() { var submenu = menuItem.querySelector('.wp-submenu'); if (submenu) { submenu.style.display = 'block'; // Show submenu } }); // Hide the submenu on mouse out menuItem.addEventListener('mouseleave', function() { var submenu = menuItem.querySelector('.wp-submenu'); if (submenu) { submenu.style.display = 'none'; // Hide submenu } }); // Toggle submenu visibility on click var menuLink = menuItem.querySelector('a'); if (menuLink) { menuLink.addEventListener('click', function(e) { e.preventDefault(); // Prevent default link behavior var submenu = menuItem.querySelector('.wp-submenu'); if (submenu) { if (submenu.style.display === 'block') { submenu.style.display = 'none'; // Hide submenu } else { submenu.style.display = 'block'; // Show submenu } } }); } });
X
Top
Add to cart
Free shipping for billing over
1.000,00
EGP