const selector = 'div p';
const removeFirst = 5;
const removeLast = 3;
document.querySelectorAll(selector).forEach((n, i, a) => {
if (i < removeFirst || i > a.length - removeLast - 1) {
n.remove();
}
});
document.querySelectorAll([
`${selector}:nth-child(-n+${removeFirst})`,
`${selector}:nth-last-child(-n+${removeLast})`,
]).forEach(n => n.replaceWith());
Т.е. часть untitled1 магическим образом
По окончанию работы скрипта, если загруженный файл не был переименован или перемещен, он будет автоматически удален из временной папки.php.net/manual/ru/features.file-upload.post-method.php
var $inputs = $('#floor, #entrance, #apartment, #intercom');
$inputs.on('blur', function(e) {
if ($(this).val()) {
$(this).next('.custom-placeholder').toggleClass('completed', true);
} else {
$(this).next('.custom-placeholder').removeClass('completed');
}
sessionStorage.setItem("PlaceholderCompleted", JSON.stringify($inputs.filter(function() {
return !!$(this).val();
}).map(function() {
return $(this).attr("id");
}).get()));
});