Skip to content
Advertisement

Price Alert:How to pass price product from a list of profucts to a popup?

I’m having a list of specific products,foreach product I have a button Create Price Alert.When I click on the button a pop up shows up and contains the price of the current product :

JavaScript

Advertisement

Answer

Are you using a lib to handle the popup, or are you using custom JS ?

If this is custom JS, there is many ways to do this, one of these being, adding a “data-price” attribute to your <tr> containing the price, and a “price” class to a <span> tag around the price in your popup.

Then, you can do this for example :

JavaScript

Your html would look like this :

JavaScript

If you are using a lib, see the doc, there is offen callbacks features available to add custom process to it.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement