javascript – How to return JSON data check match with foreach return to id

Closed. This question needs to be more focused. It is not currently accepting answers.

Update the question so it focuses on one problem only. This will help others answer the question. You can edit the question or post a new one.

Closed yesterday.

i get data from json, i want to change to table,
I want to change the value of the table attribute, value to attribute with condition (if true=check).

var arr=[ 
{"kode_dealer_md":"07629","kategori":"H1","pinpoint":"prsp"},  {"kode_dealer_md":"07629","kategori":"H1","pinpoint":"spk"},{"kode_dealer_md":"07623","kategori":"H1","pinpoint":"uinb"},{"kode_dealer_md":"07624","kategori":"H23","pinpoint":"pinb"},{"kode_dealer_md":"07625","kategori":"H1","pinpoint":"lsng"},{"kode_dealer_md":"07625","kategori":"H23","pinpoint":"prsl"}];

    var data_json = JSON.parse(arr);
    for (var i = 0; i < data_json .length; i++) {
    var obj = data_json[i];
    for (var key in obj) {
        var value = obj[key];

        alert(obj[key][1]); // how to check match  row

       if  (obj[point]=='doch'){  // condition if json idkode_dealer_mdpoint == pinpoint return to id
        $("#idkode_dealer_mddoch07628").val(); } // another else if (obj[point]=='lsng') {}

Komds | doch | lsng | prsp | spk | uinb | lsng | prsl |
07628 | trues | true | false | false |false| false| false |
07629 | false | false| trues| trues |false| false| false |

Read more here: Source link