modalContainer.scrollTop = 0;
function showModal(element) {
modalContainer.style.display = "block";
modalContainer.style.zIndex = "3";
let copyContent = element.target.closest('div').querySelector('.note-content').innerHTML;
modalContent.innerHTML = copyContent;
modalContainer.scrollTop = 0;
}
let str = 'Hi';
str[0] = 'h'; // ошибка
alert( str[0] ); // не работает
<div class="dark"></div>
.dark {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5);
cursor: pointer;
z-index: 9999;
}
function close_l() {
$('.dark').css({'display': 'none'})
$('.list_load, .list_item').stop();
$('.js-menu_toggle.opened').removeClass('opened').addClass('closed');
$('.side_menu').css({ 'left':'-270px' });
var count = $('.list_item').length;
$('.list_item').css({
'opacity':'0',
'margin-left':'-20px'
});
$('.list_load').slideUp(0);
}
$(document).on('click','.dark',function(e){
close_l();
});
$(document).on('click','.js-menu_toggle.opened',function(e){
close_l();
});
<div class="dark"></div>
.dark {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5);
cursor: pointer;
z-index: 9999;
}
$(document).on('click','.js-menu_toggle.closed',function(e){
$('.dark').css({'display': 'block'})
//
}
$(document).on('click','.js-menu_toggle.opened',function(e){
$('.dark').css({'display': 'none'})
//
}
<select name="type" id="select_type" onchange="foo(this)">
<option value="none" hidden="">Выберите донат</option>
<option value="100">Донат за 100 рублей</option>
<option value="50">Донат за 50 рублей</option>
<option value="20">Донат за 20 рублей</option>
</select>
<button type="submit">Купить за <span id="price"></span> руб.</button>
function foo(e) {
document.getElementById('price').innerHTML = e.value;
}