Definition and Usage
The id attribute specifies a unique id for an HTML element (the value must be unique within the HTML document).
The id attribute is most used to point to a style in a style sheet, and by JavaScript (via the HTML DOM) to manipulate the element with the specific id.
$('.timer').each(function(){
$timer = $(this)
setInterval(function(){
let day = $timer.find('.TD').text(),
hours = $timer.find('.TH').text(),
minutes = $timer.find('.TI').text(),
seconds = $timer.find('.TS').text();
// ...
}, 1000)
})
var correctAnswers = $('.que .correct')
correctAnswers.each(function(index, element){
console.log($(element).text())
});
console.log("Верных ответов: " + correctAnswers.length)
let map = new WeakMap();
let key = {};
map.set(key, 'keyVal');
console.log(map)
key = null;
setTimeout(function(){
console.log(map)
}, 1000)
$("#send").click(sendform());
а нужно $("#send").click(sendform);
<div class="articles">
<? foreach($articles as $article) { ?>
<div class="article">
<h1><?=$article->getTitle()?></h1>
<img src="/oldimages/<?=$article->getImg()?>">
<span class="date"><?=date('Y-m-d', $article->getPublicationDate())?></span>
</div>
<?}?>
</div>
[1,2,3].pop() // -> 3
Чтобы без лишних операций в виде поиска длины массиваИ вообще, нет никакой операции поиска, длина массива - это свойство самого массива, и обращение к элементу через индекс (вот как у вас сейчас) гораздо быстрее, чем модифицировать массив )
h1 {
background: url(путь к изображению);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
document.querySelector('.test').click() // клик по первому найденному с классом test
https://jsfiddle.net/hqsrq2jt/