<picture class="img-wrapper">
<source srcset="https://www.gstatic.com/webp/gallery2/5.webp" type="image/webp">
<img src="https://www.gstatic.com/webp/gallery2/5.png" alt="example" class="img-responsive">
</picture>$('body').on('click', '.password__control', function () {
var $this = $(this)
var $closestPass = $this.prevAll('.password')
if ($closestPass.attr('type') == 'password') {
$this.addClass('view');
$closestPass.attr('type', 'text');
} else {
$this.removeClass('view');
$closestPass.attr('type', 'password');
}
return false;
});
const createTable = (
rows,
cols,
cell,
{
rowSeparator = '\n',
colSeparator = '',
} = {},
) =>
Array.from({ length: rows }, (_, i) =>
Array.from({ length: cols }, (_, j) =>
cell(i, j)
).join(colSeparator)
).join(rowSeparator);console.log(createTable(8, 8, (i, j) => (i ^ j) & 1));
document.body.innerHTML = createTable(
30,
50,
(i, j) => (i + j) % 2,
{ rowSeparator: '<br>' }
); $(function(){}) — это мы запускаем действие в момент загрузки страницы. А оборачиваем в анонимную функцию (function($){ })($);, чтобы избежать конфликта имен с $. (function($){$(function(){
$('select').styleThis();
})})(jQuery);$("input").focus(); target="_blank" для тега form - это заставит форму открываться в новом окне. Во вторых, на событие submit у формы надо повесить обработчик, который поменяет адрес у текущей вкладки при отправке. Если не умейте в JS то такой обработчик тоже в принципе можно повесить через атрибуты:<form target="_blank" onsubmit="location.href='https://yandex.ru'" action="send.php">
...
</form>
arr.filter(RegExp.prototype.test.bind(/^[рим]*$/i))
// или
arr.filter(n => !n.match(/[^рим]/i))
// или
arr.filter(n => !n.replace(/р|и|м/gi, ''))
// или
arr.filter(n => [...n.toLowerCase()].every(m => 'рим'.includes(m)))