Skip to content

Render div with state only on phones

is there some way how to render div conditionally with state but only for mobiles? I have show more button, but i need it only for phone resolution, also I need to display that div with className text every time on desktop Answer you can set the active class in the media query. At first, you can this div disp…

Paypal dynamic value in react js

I need help with my project I want to add a dynamic option to the PayPal payment process. ( change the value to be dynamic ) the default option is value: ‘0.01’ and the dynamic payment in my project is cart.subtotal.formatted_with_symbol I try to add [const {amount} = cart.subtotal.formatted_with_…

JavaScript Accessing Data From Imported Script

So I’m trying to export/import script from model.js and I use this Here’s the script of model.js This is the render part where I’m trying to access recipe part from model.js. I’m trying to access recipe part here: const { recipe } = model.loadRecipe; But I’m getting undefined. Pl…

(Javascript) Trying to make class methods use input values

im working on a very simple program that allows me to calculate my budget. Still trying to learn JS, and having few problems that I cant find answers to. I need to get the value of the inputs i have in html The question is, how can i make the addItem() method to the values of the inputs specified in