JavaScript Problem #5555

<script>

    add= document.getElementById("add");

    add.addEventListener("click", ()=>

    {

        console.log("updating List...");

        tit= document.getElementById('title').Value;

        desc= document.getElementById('discription').Value;

        if(localStorage.getItem('itemjson')==null){

             itemJsonArray = [];

             itemJsonArray.push([tit, desc]);

             localStorage.setItem('itemsJson' , JSON.stringify(itemJsonArray))

        }

    });

!!!I want to display values of Id’s title and Discriptio In Local storage but Code Is not Working can any one Please Guide Thanks Its Printing Values "null"Preformatted text!!!

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

Sorry I am new here but I didn’t find any solution

add= document.getElementById("add");
    add.addEventListener("click", ()=>
    {
        console.log("updating List...");
        tit= document.getElementById('title').Value;
        desc= document.getElementById('discription').Value;

        if(localStorage.getItem('itemjson')==null){
             itemJsonArray = [];
             itemJsonArray.push([tit, desc]);
             localStorage.setItem('itemsJson' , JSON.stringify(itemJsonArray))
        }
    });

Can you Please give me a solution

It would really help if you put at least your HTML and JS into something like codepen so we can see everything. At this point we just have to guess. I’m guessing the following:

desc= document.getElementById('discription').Value;

Should this be “description” instead of “discription”? Also, I’m guessing you are looking for value not Value. Same Value issue for the title as well.

Just noticed another one. You are saving data to local storage using itemsJson but you are using itemjson in getItem.