Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67469

How to show data from JQuery into html tag

$
0
0

There are some html p tag code at below:

<div class="row">
    <h5 class="col-md-3">Status: </h5><p id = "status" class="col-md-9"></p>
</div>
<div class="row">
    <h5 class="col-md-3">Block: </h5><p id = "block" class="col-md-9"></p>
</div>

JQuery:

$.each(data.txDetails, function(key, val) {
    if(key == 'status') {
        $('#'+key).find('input[value="'+val+'"]').attr('checked', 'checked');
    }
    else {
        $('#'+key).val(val);
    }
});

I would like to ask about how JQuery data will show on the html p tag? I'm very sure that my data.txDetails have data. The keys of the data.txDetails are same as p tag id. But then, there is no value to show on the p tag. how to solve it? Thanks in advance


Viewing all articles
Browse latest Browse all 67469

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>