$('span').eq(2).text( $('input').val() )
...
document.querySelector('element-grid__like-button').addEventListener("click", LikeButton)
...
...
document.querySelector('.element-grid__like-button').addEventListener("click", LikeButton)
...
function isPrime( num )
{
if( num <= 1 )
return false;
for( i = 2; i * i <= num; i ++)
{
if( num % i == 0 )
return false;
}
return true;
}
function mouseMove()
{
console.log('Запуск функции');
window.onmousemove = ttt;
window.onmousedown = yyy;
}
function ttt() {
console.log('Движение');
}
function yyy() {
console.log('click');
window.onmousemove = null;
}
let arr = [ 3,3,3,3,2 ]
let main_digit = ( arr.reduce( (a,b) => a + b, 0 ) / arr.length ).toFixed(0)
let excess_digit = ( arr.filter( ( item, index ) => item != main_digit ))[0]
console.log( excess_digit )
let arr = [...document.getElementsByClassName("test_class")]
for (let i=0; i < arr.length; i++) {
arr[i].onclick = function(){
alert("Click!");
}
};
arr.forEach(function(entry) {
entry.onclick = function(){
alert("Click!");
}
});
arr.map(function(entry) {
entry.onclick = function(){
alert("Click!");
}
return entry;
}
...
success: function(res){
$('#slides').append(res);
$('button.add-slide').prop('disabled',true)
// или вообще так:
$('button.add-slide').hide()
},
...