如何在值输入html中加载数据网站

I am having this piece of code, to load data form PHP in hosting. Then I am displaying received data to value input :

$("#MerekDagang").load("http://jiyo-hotel.com/bpom/data.php?id=1&act=Get_MerekDagang").value;

The question is how to load data and insert as a input value here:

<input type='text' class='form-control' name='Merek_Dagang' placeholder='Merek Dagang' id='MerekDagang' value=''>

That's not the right way to use the .load method in jquery. It's trying to load the data result into that element tag (which is not a wrapping element, it's a singular input element).

You should use this instead:

$(document).ready(function(){
    $.get("http://jiyo-hotel.com/bpom/data.php?id=1&act=Get_MerekDagang",function(data){
        $("#MerekDagang").val(data);
    });
});

This explicitly tells where that data should go (into the val of the element selected).

P.S.: I'm not sure why you would want to immediately load data in through ajax like this though... seems inefficient, where you could have put that data in during the php output build.