As in Yandex.Cards to make multiple SuggestView?

Good afternoon.
Must visit to make a few input type="text" that is added by JQuery to the introduction of address points on the map:

HTML:
<div class="address_section">
 <div id="inputlar">
 <p class="first_element"><span></span><input type="text" value placeholder="City, street, building, structure, body" id="pac-input1" name="pac-input1" data-count="1" class="controlsInput"><em class="clear_first">×</em></p><div class="my-suggest-container"></div><p></p>
</div>
 <a href="#" class="new_address_btn">Add address</a>
</div>
 <div id="map_canvas"></div>


When typing the address in(!) input should appear in the tooltip for that particular input

JS:

ymaps.ready(init);
function init () {
 var myMap = new ymaps.Map('map_canvas', {
 center: [51.1480773, 71.4562873],
 zoom: 9,
 behaviors: ['scrollZoom', 'drag'],
 controls: ['zoomControl', 'typeSelector', 'rulerControl']

});
}

function onLoad (ymaps) {
 var inputs = document.getElementsByClassName("controlsInput");
 var suggestView;
 for (var i = 1; i < inputs.length+1; i++) { //Start of problem area
console.log(i);
// Next only works for the first input with ID=pac-input1
 suggestView = new ymaps.SuggestView('pac-input'+i, {
 boundedBy: [[40.817717596787695, 45.810683499999996], [54.95398155782081, 87.99818349999998]]
});
 suggestView.events.add('select', function(e){
console.log(e.get('item').value);
});
}
}

$(document).ready(function(){
 var cnt = 1;
$(".new_address_btn").click(function(e){
 var count = parseInt($('.address_section p').length);
e.preventDefault();

 if (count < 10) {
 // count=count+1;
cnt++;
 $("#inputlar").append("<p class="second_address"><span>" + count + "</span><input id="pac-input" + count + "" class="controlsInput" type="text" placeholder="City, street, building, structure, building" data-count="" + cnt +""><em class="addr_remove">×</em></p>");
 $('.address_section p:first-child span').text('1').css('opacity', '1');
$('p.alert').remove();
 var newInput = [];
 var newEl = document.getElementById('pac-input' + count);
newInput.push(newEl);
onLoad();
 } else {
 $(this).before('<p class="alert">Too many addresses.</p>');
}
});
});


In the description SuggestView from Yandex to element see "HTML element or id." But if I have a few items?

The second question is how the data received from each input (when selected the prompt suggestView.events.add('select') or blur from the input) to send to the geocoder and put a mark on the map?
July 4th 19 at 22:44
0 answer

Find more questions by tags JavaScriptjQuery