$('from [name="address"]').keyup(function(){
if($(this).val().toLowerCase().indexOf('москва') > -1) {
$('form select').html('<option>1</option><option>2</option>');
}
});
// код
function chti($string, $ch1, $ch2, $ch3){
$ff=Array('0','1','2','3','4','5','6','7','8','9');
if(substr($string,-2, 1)==1 AND strlen($string)>1) $ry=array("0 $ch3","1 $ch3","2 $ch3","3 $ch3" ,"4 $ch3","5 $ch3","6 $ch3","7 $ch3","8 $ch3","9 $ch3");
else $ry=array("0 $ch3","1 $ch1","2 $ch2","3 $ch2","4 $ch2","5 $ch3"," 6 $ch3","7 $ch3","8 $ch3"," 9 $ch3");
$string1=substr($string,0,-1).str_replace($ff, $ry, substr($string,-1,1));
return $string1;
}
// использование
echo chti(21,'минута','минуты','минут');
Моделей в корзине: <?=$arResult["COUNT_FITTING"];?>
<span class="active btn-v-korzinu">
var myBtn = document.querySelector('.btn-v-korzinu')
myBtn.addEventListener('click', function(){
ga('send', 'pageview', '/knopka-v-korzinu')
})
myBtn.addEventListener('click', function(){
_gaq.push(['_trackEvent', 'Knopka', 'Podtverdit']);
})
myBtn.addEventListener('click', function(){
alert('hello world');
}) // можно добавлять сколько угодно.
myBtn.addEventListener('click', function(){
ga('send', 'pageview', '/knopka-v-korzinu')
_gaq.push(['_trackEvent', 'Knopka', 'Podtverdit']);
alert('hello world');
})
<?php foreach ( $arResult as $key => $person ): ?>
<td>
<?php if ( $person['Q19'] == 'N' ): ?>
<label>
<input type="radio" value="<?php echo ($key+64); ?>" name="vca">
<span style="color:green">СВОБОДНО</span>
</label>
<?php else: ?>
<span style="color:grey">Не доступно</span>
<?php endif; ?>
</td>
<?php endforeach; ?>
<ul class="menu">
<li class="menu__item">
<div class="menu__wrapper">
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
</div>
</li>
<li class="menu__item">
<div class="menu__wrapper">
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
</div>
</li>
<li class="menu__item">
<div class="menu__wrapper">
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
</div>
</li>
<li class="menu__item">
<div class="menu__wrapper">
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
</div>
</li>
<li class="menu__item">
<div class="menu__wrapper">
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
<a href="" class="menu__link"><img src="" alt="" class="menu__image"></a>
</div>
</li>
</ul>
<?php
if ($arItem['DISPLAY_PROPERTIES']['FILES']['VALUE'] > 0) {
?>
<div class="col-sm-6 col-lg-4">
<div class="item-preview-hover banner">
<a href="<?php echo $arItem['DISPLAY_PROPERTIES']['LINKS']['VALUE']; ?>">
<img src="<?php echo $file_path; ?>" width="250" height="250" class="img-responsive" />
</a>
</div>
</div>
<?php
} else {
echo "Нет изображения";
}
?>
<?php
$arr = [
['firsname' => 'Иван', 'lastname' => 'Иванов'],
['firsname' => 'Петр', 'lastname' => 'Петров'],
['firsname' => 'Сергей', 'lastname' => 'Сергеев'],
]
?>
<table>
<tr><th>ID</th><th>Имя</th><th>Фамилия</th></tr>
<?php foreach($arr as $key => $person): ?>
<tr>
<td><?=$key?></td>
<td><?=$person['firsname']?></td>
<td><?=$person['lastname']?></td>
</tr>
<?php endforeach ?>
</table>