Vap-Access Posted September 25, 2017 Share Posted September 25, 2017 (edited) Hello ! I have a problem with my quantity button, when I click it nothing happens. I have tested my code here and it works well: https://jsfiddle.net/0zs2p3h5/1/ But once implanted in the site it does not work, nothing happens. I have another code, which was there before (but which did not work either), available here: http://jsbin.com/juwumobefe/edit?html,output By here if you want to see the live button on my site: here I'm a beginner in Javascript so I think I've forgotten something somewhere but it's been several days that I'm stuck on it so I come to get help! Sorry for my English, this is not my native language Edited September 26, 2017 by Vap-Access (see edit history) Link to comment Share on other sites More sharing options...
catalin.pop Posted September 25, 2017 Share Posted September 25, 2017 Hello. First, can you paste your link one more time. I think the one you provided is broken. Second you should check your browser console for errors: ctrl+shift+k for Firefox or ctrl+shift+j for Chrome https://developers.google.com/web/tools/chrome-devtools/console/ Link to comment Share on other sites More sharing options...
Vap-Access Posted September 26, 2017 Author Share Posted September 26, 2017 Hello. First, can you paste your link one more time. I think the one you provided is broken. Second you should check your browser console for errors: ctrl+shift+k for Firefox or ctrl+shift+j for Chrome https://developers.google.com/web/tools/chrome-devtools/console/ Updated, It was the link to my shop right ? Link to comment Share on other sites More sharing options...
catalin.pop Posted September 26, 2017 Share Posted September 26, 2017 From what I see there are no events attached to up/down arrows Here is from your jsfiddle: Here is from your website As you can see there are no events attached to those elements. And based on your page content is logic to happens like this. You've added the js code in your header (<head></head>) which is rendered first, then the <body> content where your elements are. With other others you want to apply js code to elements that are not yet created. What you need to do is bundle your code in a $( document ).ready which is called like this The .ready() method offers a way to run JavaScript code as soon as the page's Document Object Model (DOM) becomes safe to manipulate. $( document ).ready(function() { // put your code here }); https://api.jquery.com/ready/ Link to comment Share on other sites More sharing options...
Vap-Access Posted September 26, 2017 Author Share Posted September 26, 2017 Hello Catalin.pop Thank you so much dude, it's work fine ! You are the best Peace! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now