document.getElementById();
class SomeClass {
constructor(name) {
this._name = name
}
get name() {
return this._name;
}
set name(value) {
this._name = value;
}
}
const user = new SomeClass('Eric');
console.log(user.name);
user.name = 'Jhon';
console.log(user.name);
document.querySelector('.post_content.m20').onclick = event => {
const element = event.target.closest('.title_spoiler');
if (element) element.classList.toggle('active');
if (element && element.classList.contains('acitve')) {
const frame = element.nextElementSibling;
const link = frame.dataset.src;
frame.setAttribute('src', link);
frame.removeAttribute('data-src');
}
}
document.addEventListener('keypress', event => {
if (event.keyCode === 13) {
const href = location.href.split('/');
href[href.length - 1] = input.value + '.html';
location.href = href.join('/');
}
});