8
KPCKevin Powell - Community
•Created by 8 on 7/31/2023 in #front-end
document.getElementById() not working
Hello, I tried to use event listener on an element but document.getElementById() returns null instead of the element. The problem is that I can't find any problem and I tired the code on multiple online compiler and it worked in all of them but it doesn't work on VScode.
HTML:
JavaScript:
7 replies
KPCKevin Powell - Community
•Created by 8 on 6/4/2023 in #front-end
Shopping cart total price does not update
Hello, I am creating a shopping cart from this tutorial: https://www.youtube.com/watch?v=YeFzkC2awTM&t=940s but when I add new items the total price counter does not update and I can add two of the same item
This is my code:
https://codepen.io/SuperTesmon/pen/OJaLLWX
8 replies
KPCKevin Powell - Community
•Created by 8 on 6/3/2023 in #front-end
innerText is undefined
I am trying to code a very basic shop for a school project and I tried to get the price of a product by using innerText in a function to update the total price in the cart but when I checked in the console I get this error:
caught TypeError: Cannot read properties of undefined (reading 'innerText')
The function code:
25 replies
KPCKevin Powell - Community
•Created by 8 on 5/17/2023 in #front-end
How to make a section responsive to screen size?
Hello, I have a section with text and Image side by side. (Text on the right, image on the left)
I know how to use CSS @media max-width and min-with but I am using display flex on the section to make the image side by side with the text and it doesn't work now.
HTML code:
https://pastebin.com/sZm8TS75
CSS code:
https://pastebin.com/3L3sNAD2
6 replies