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