function move(moveSpeed = 10) {
const ballTop = ball.getBoundingClientRect().top;
if (ballTop > 0){
ball.style.top = ballTop - moveSpeed + "px";
};
};
const url = i.querySelector('.msga2 > a')?.getAttribute('href');
let link;
if (url) {
link = 'https://www.doska.by/' + url
}
Number.prototype.toFixed()
Возвращаемое значение
Строка, представляющая numObj, не использующая экспоненциальную запись и содержащая ровно digits цифр после десятичной запятой.
const give_link = document.getElementById('give_link')
const receive_link = document.getElementById('receive_link')
const btn_create_link = document.getElementById('btn_create_link')
btn_create_link.onclick = function() {
receive_link.value = give_link.value;
}
receive_link.value = `<a href="${give_link.value}">${give_link.value}</a>`;
class TotallyNotAjQuery {
constructor() {
this.inf = {
$el: null
}
this.el = this.el.bind(this);
}
el(selector) {
this.inf.$el = document.querySelector(selector);
return this;
}
styles(stylesObj) {
for(const primary in stylesObj) {
this.inf.$el.style[primary] = stylesObj[primary];
}
return this
}
on(event, func) {
this.inf.$el.addEventListener(event, func);
return this;
}
}
const {el: $} = new TotallyNotAjQuery();
$(".title").styles({
color: "red"
}).on("click", () => {
console.log("click");
});