How to conclude house numbers on the street?

Hello, I have a question: how to conclude houses at the specified address? I myself a php developer, so I know bad js, and front-end developer do not know him. On the Internet I came across KLADR API. Long studied the documentation but did not understand. In the end, I wrote code to output the streets, but I still do not understand how on this street take the resulting parentId and assign it to the field to display homes.

There is a jquery plugin (https://github.com/garakh/kladrapi-jsclient )
$('#streeta').kladr({
 parentType: $.kladr.type.city
 parentId: '2100000100000',
 type: $.kladr.type.street,
 verify: true
 });

5a315d120005e060828579.png
June 10th 19 at 15:28
2 answers
June 10th 19 at 15:30
Solution
A little brush up on Js and Jq, and several times have read the documentation. It worked for me. Thank you all for the help!
My code with comments:
$(function () {
 var $city = $('#cityadress'), //city
 $street = $('#streeta'), //street
 $building = $('#hausea'); //back

 var $tooltip = $('.tooltip');

$.kladr.setDefault({
 parentInput: '#add_from', //id of the form where the fields are for entering addresses
 verify: true
 select: function (obj) {
 setLabel($(this), obj.type);
$tooltip.hide();
},
 check: function (obj) {
 var $input = $(this);

 if (obj) {
 setLabel($input, obj.type);
$tooltip.hide();
}
 else {
 showError($input, 'incorrect');
}
},
 checkBefore: function () {
 var $input = $(this);

 if (!$.trim($input.val())) {
$tooltip.hide();
 return false;
}
}
});
//For each simply connected KLADR settings
$city.kladr({
 parentType: $.kladr.type.district,
 type: $.kladr.type.city
 verify: true
});
$street.kladr({
 parentType: $.kladr.type.city
 type: $.kladr.type.street,
 verify: true
});
$building.kladr({
 parentType: $.kladr.type.street,
 type: $.kladr.type.building
 verify: true
});




 // Disable the verification of the data entered for buildings
 $building.kladr('verify', false);

 function setLabel($input, text) {
 text = text.charAt(0).toUpperCase() + text.substr(1).toLowerCase();
$input.parent().find('label').text(text);
}

 function showError($input, message) {
$tooltip.find('span').text(message);

 var inputOffset = $input.offset(),
 inputWidth = $input.outerWidth(),
 inputHeight = $input.outerHeight();

 var tooltipHeight = $tooltip.outerHeight();

$tooltip.css({
 left: (inputOffset.left + inputWidth + 10) + 'px',
 top: (inputOffset.top + (inputHeight - tooltipHeight) / 2 - 1) + 'px'
});

$tooltip.show();
}
 });
June 10th 19 at 15:32
I do not understand, you in console.log can display kladr separately and also all the fields that you are getting using the plugin?
And as I understand you this kladr to be inserted into a specific input?

Find more questions by tags KLADERAPIJavaScript