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?
User | RANK |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023