如何在使用新FormData()时获取ID; 的JavaScript /笨

I wasted 3 hours searching for the right syntax. How can i get the value of "prop_id" in javascript.

view -

  <input type="hidden" name="prop_id" value="<?=$prop_id_inserted?>">

javascript

function upload_docu_by_type(prop_id, input, filetype) {
var fd = new FormData();
var fileInputs = $("." + input);

$.each(fileInputs, function (i, fileInput) {
    if (fileInput.files.length > 0) {
        $.each(fileInput.files, function (k, file) {
            fd.append('images[]', file);
        });
    }
});
fd.append("prop_id",input);
fd.append("file", filetype);

$.ajax({
    type: "POST",
    url: base_url + "applicant_w/upload_docu_by_type",
    data: fd,
    dataType: 'json',
    contentType: false,
    processData: false,
    success: function (response) {

    }
})

controller

public function upload_docu_by_type() {
    $this->load->helper(array('form', 'url'));
    $F = array();
    $prop_id = sanitize($this->input->post('prop_id'));
    $file = sanitize($this->input->post('file'));

i want to get it in controller.

Use below code snipped, hope it work for you!

$("input[name='prop_id']").val();

I think this will work in JS:

document.getElementsByName("prop_id")[0].value;

prop_id = document.getElementsByName("prop_id")[0].value;
console.log(prop_id);
<input type="text" name="prop_id" value="test">

</div>