$('#signupform-region').change(function(){
if ($("select[id=signupform-city] option").size() != 0) {
$('#signupform-city').prop('disabled',false);
} else {
$('#signupform-city').prop('disabled','disabled');
}
});
<?php $my_array = ArrayHelper::map(Region::find()->andWhere(['country_id'=>3159])->all(),'id','title'); ?>
<?= $form->field($model, 'region')->dropDownList(
$my_array,
[
'prompt'=> 'Выберите регион',
'onchange'=>'
$.post("index.php?r=site/city&id='.'"+$(this).val(), function(data){
$("select#signupform-city").html(data);
});'
]); ?>
document.querySelectorAll('img')
let images = [].slice.call(document.querySelectorAll('img'))
images.forEach((img, i)=>{
console.log(
'image #' + i,
' width=' + img.width,
' height=' + img.height,
' src=' + img.src
)
})
Демо: https://jsfiddle.net/j5jjqraj/let img = document.querySelector('img')
for(let propertyName in img) {
let value = img[propertyName]
console.log(propertyName, ':', value)
}
Демо: https://jsfiddle.net/vx39wfzh/