How do I retrieve a value from local storage and set it in an HTML input field?

I am building a prescription maker. But I am facing a problem. I want to show to localstorage data in the select box. But I can’t. So I need help. Actually i just need a function that detects my row index of table and print the data according to the index in the input field. Thanks in advance

        function editpres(){   
    var aha = JSON.parse(localStorage.getItem('books'));
    document.getElementById('name').value = aha[0].name;
    document.getElementById('age').value =aha[0].age;
    document.getElementById('sex').value = aha[0].sex;
    document.getElementById('date').value = aha[0].date;
    document.getElementById('disease').value = aha[0].disease;
    document.getElementById('dignosis').value = aha[0].dignosis;
        <table class="table table-success table-striped ">
            <th>Patient Name</th>
        <tbody id="book-list"></tbody>

Hi there, @Sakibthenoobcoder

I’m not sure if I’m completely following this but I’ve made a jsbin that adds people to inputs with the IDs you’re using here:

That should point you in the right direction I think.

Billy :cowboy_hat_face: