.querySelector
вместо этого создайте хук useState
храните в нем ваше значение и используйте переменную где хотите. При необходимых ситуациях можно и изменять это значениеconst [ text, setText ] = React.useState('Text1');
<h3 className='text'>{text}</h3>
setText('новый текст');
const arr = [
[ 'author', 'Author - ' ],
[ 'name', 'Name' ],
[ 'currentTime', '00:00' ],
[ 'duration', '00:00' ],
];
for (const [ className, text ] of arr) {
titleElement.appendChild(create({
el: 'span',
className,
text,
}));
}
// или
titleElement.append(...arr.map(n => create({
el: 'span',
className: n[0],
text: n[1],
})));
// или, без всех этих ваших странных функций
document.querySelector('#root').innerHTML = `
<div id="title">${arr.map(n => `
<span class="${n[0]}">${n[1]}</span>`).join('')}
</div>
`;
const els = [
["author", "Author - "],
["name", "Name"],
["currentTime", "00:00"],
["duration", "00:00"],
];
els.forEach(el => {
titleElement.appendChild(
create({
el: "span",
className: el[0],
text: el[1],
})
);
})
const els = [
{ el: "span", className: "author", text: "Author - " },
{ el: "span", className: "name", text: "Name" },
{ el: "span", className: "currentTime", text: "00:00" },
{ el: "span", className: "duration", text: "00:00" },
];
els.forEach( el => titleElement.appendChild( create(el) ) );
function renderTitle (d) {
return `
<div class="title">
<span class="currentTime">${d.time}</span>
<span class="author">${d.author}</span> –
<span class="name">${d.name}</span>
<span class="duration">${d.duration}</span>
</div>
`;
}
xxx.insertAdjacentHTML('beforeend', renderTitle({
author: 'Author - ',
name: 'Name',
time: '00:00',
duration: '00:00',
}));
.addEventListener("click", player.prevAudio)
header: int, list of int, None, default ‘infer’https://pandas.pydata.org/docs/reference/api/panda...
Row number(s) to use as the column names, and the start of the data. Default behavior is to infer the column names: if no names are passed the behavior is identical to header=0 and column names are inferred from the first line of the file, if column names are passed explicitly then the behavior is identical to header=None. Explicitly pass header=0 to be able to replace existing names. The header can be a list of integers that specify row locations for a multi-index on the columns e.g. [0,1,3]. Intervening rows that are not specified will be skipped (e.g. 2 in this example is skipped). Note that this parameter ignores commented lines and empty lines if skip_blank_lines=True, so header=0 denotes the first line of data rather than the first line of the file.
$("prev").addEventListener("click", prevMonth, false);
$("next").addEventListener("click", nextMonth, false);
$("next")
- Это что такое? Если следовать правилам, то это "next" это селектор по тэгу. Такого тега не существует.