$(document).on('hover', '.help_p', function(e){
if (e.type === "mouseenter") {
$('#tipDiv').css({ "visibility":"visible"});
} else {
$('#tipDiv').css({ "visibility":"hidden"});
}
});
var handler = new Handler();
handler.go();
this.go = function () {}
Handler2.prototype = Object.create(Handler.prototype);
Handler2.prototype.constructor = Handler;
const domElements = {};
function addToCounter (elem) {
domElements[elem.tagName] = typeof domElements[elem.tagName] === 'undefined' ? 1 : domElements[elem.tagName] + 1
}
function scanDOM (elem) {
if (elem.hasChildNodes()) {
for(let i = 0; i < elem.childNodes.length; i++) {
let child = elem.childNodes[i];
if (child.nodeType == 1) {
addToCounter(child);
scanDOM(child);
}
}
} else {
addToCounter(elem);
Object.keys(domElements).forEach((val) => {
console.log(`There are ${domElements[val]} elements with ${val} tag name `);
})
}
}
let body = document.querySelector('body');
scanDOM(body);
<body>
<div class="main">
<div class="content">
</div>
<div class="table">
Этот див рендерится динамически
</div>
<div class="footer">
</div>
</div>
</body>
.main {
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: space-between;
}
$( 'input[name="alloff"]:radio' ).on('change', function(e) {
$('input[name^="Aktiv"][value=' + $(this).attr('value') + ']').prop('checked', true);
});
img = el;
$('.b-channel__cover').each(function(i,el){
var img = new Image();
img.onload = function(){alert('картинка существует')};
img.onerror = function(){alert('картинка не существует')};
img.src = $(el).attr('src')
});
$('p').contents().filter(function(){return this.nodeType === 3}).wrap('<span />');