How to call one Javascript function on different places in one amp HTML document using ID or Class?
Call add to cart to perform action on this id
I want to append result in this amp script container or add any div in this container but script will remain same addToCart
Note : Conclusion is that I want to execute one function and parse id in this and show result on another div or something in replace
@morsssss This looks like a question about how you could execute something with AMP Script. Could you take a look and see if we have adequate answers in our documentation?
Hey @danyal1248 ! I can't entirely tell what you're trying to do from the partial code you provide. It does look like you want to make it so that when a user clicks one DOM element, you set a state variable to false.
If that's it, does this sample help?
If that's not enough, please feel free to ask for more detailed help on Stack Overflow - or to sign up for the AMP Slack channel, where AMP developers discuss questions like this.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.