input - класс s-input . dropdown - класс dropdown. box - класс s-box
<div class="s-box">
<input type="text" id="input" autocomplete="off" class="s-input">
<input type="text" id="????" autocomplete="off" class="????">
<input type="submit" class="s-btn" value="Найти">
<ul class="dropdown" id="dropdown"></ul>
</div>function box_listener(box){
const input = box.querySelector('.s-input');
const dropdown = box.querySelector('.dropdown');
if (input.value === '') dropdown.style.display = 'none';
const fetch_data = _ => {
$.post("files/auto_complet.php", { s: input.value }, (data, status) => {
if (data != "not found") {
dropdown.style.display = 'block';
dropdown.innerHTML = data;
box.querySelectorAll('.dropdown li').forEach(item => {
item.onclick = () => e.target.value = item.innerText;
});
}
});
}
input.oninput = fetch_data;
input.onclick = fetch_data;
}
document.querySelectorAll('.s-box').forEach(box => {
box_listener(box);
});
document.body.onclick = e => {
document.querySelectorAll('.dropdown').forEach(el => el.style.display = 'none');
} function clear_key(obj, k) {
if(obj && k) {
Object.keys(obj).forEach(key => {
obj[key][k] = undefined;
});
return;
}
throw 'Object and key is required';
}function clear_key(obj, k) {
if(obj && k) return Object.keys(obj).forEach(key => obj[key][k] = undefined);
throw 'Object and key is required';
} parseInt(atob(_0x5fd69b)[_0x00dd('0x2')](/\D/g, '')
_0x00dd('0x2')
let a = btoa(12345);
console.log(parseInt(atob(a)[0].replace('2', ''))) .test(str) => .test(el)
function pigIt(str){
const splitted = str.split(' ');
return splitted.map(el => {
console.log(el)
if(el.length === 1 && !new RegExp(/^[a-zA-Zа-яА-Я0-9]+$/).test(el)) return el;
const es = el.split('');
es[es.length] = es[0];
es.splice(0, 1);
return es.join('') + 'ay';
}).join(' ');
} <form action="/send_file" method="post" enctype="multipart/form-data" class="upload_form" id="file-upload">
<input type="file" name="avatar" id="file" multiple>
<button class="begin_uploading_button">Загрузить файлы</button>
<label for="file" class="upload_label">Выбрать файл</label>
<input type='text' name='some_data' value='some value' style='display: none'>
<input type="submit" name="submit" value="Загрузить" class="submit_button">
</form>