Personalized checkout and custom promotions with Shopify Scripts
Hey! I want to do a counter, which counts a number of typed letters in the input box (Kids name).
Link for this page: https://child-universe.com/collections/name-puzzle/products/hedgehog-board-name-puzzle
It's plugin input "Best Custom Products Option". I use javascript to do this function. When I tested it in Chrome Console, it worked perfectly. But when I tried to use it in theme code, it doesn't work. I think the reason is my code is not executing at the end of the page. (I placed my code at the end of theme.liquid file and console.log some text, after I saw what my code execute at the beginning).
So, i need to addEventListener for this input.
I do:
document.querySelector("MY INPUT").addEventListener("input", function(){
// script which count letters
});
After placing it in file, i got err in console.
How i can fix that, or make my code run at the end?
We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024