I have a function:
function updateIata(input) { input.siblings('span.iata-code').css({ 'top': '1px', 'opacity': '0' }); $.getJSON('/json/cities.json', function(data) { for(var i = 0; i < data.length; i++) { if(data[i].name_translations.ru == input.val()) { input.siblings('span.iata-code').text(data[i].code).css({ 'top': '10px', 'opacity': '1' }); } } }); } In the body of which changes are made associated with the style of input. This function is called by the change event:
$('input.iata-updater').on('change', function(){ updateIata($(this)); // нерабочий вариант }); nothing is passed to the .siblings () function. Cannot read property 'siblings' of undefined
The problem is that I have two inputa with this class. How can I pass to the function information about which particular input has been changed?
Cannot read property 'siblings' of undefined- JamesJGoodwin