skip to Main Content

Jquery – adding json data value

I am trying to create cart using js function fuBuyNow() { var prodqty = 1; var prodid = localStorage.ls_productID; var prodprice = $('#ppriceoffer').html(); var cartItem = { productid: prodid, productqty: prodqty, productprice: prodprice }; var cartItemJSON = JSON.stringify(cartItem); console.log(cartItemJSON); var…

VIEW QUESTION

Html – The code seems to be fine, but not getting the output. Expected output : Replace text "Heading 1" on browser with array from new.js file

I have 2 files index.html and new.js but could not get the output on browser as expected. The error shows on document.getElementById("h1").innerHTML=fruits; //fruits: name of the array also tried document.getElementById("h1").innerHTML= fruits.join(", "); //got this from chat gpt //new.js file content…

VIEW QUESTION
Back To Top
Search