Почему я не могу скопировать текст по кнопке?
в браузере все норм а в рейдже не работает
ниже код
в браузере все норм а в рейдже не работает
ниже код
HTML:
<div class="d-flex column">
<div class="menu-text">Ваши координаты:</div>
<div class="c-input-block mt-5" style="width: 280px;">
<input v-model="coords.ground" id="input-1" class="c-input" placeholder="Координаты земли ( -1 по Z )">
</div>
<button class="c-button mt-5" id="copyText1">Копировать 1</button>
<div class="c-input-block mt-5" style="width: 280px;">
<input v-model="coords.standart" id="input-2" class="c-input" placeholder="Координаты персонажа">
</div>
<button class="c-button mt-5" id="copyText2">Копировать 2</button>
<div class="c-input-block mt-5" style="width: 280px;">
<input v-model="coords.rot" class="c-input" placeholder="Поворот">
</div>
<button @click="getMyCoords();" class="c-button mt-5">Получить</button>
</div>
JavaScript:
var text = document.getElementById("input-1");
var text1 = document.getElementById("input-2");
/* return button to variable btn */
var btn = document.getElementById("copyText1");
var btn1 = document.getElementById("copyText2");
/* call function on button click */
btn.onclick = function() {
text.select();
document.execCommand("copy");
}
btn1.onclick = function() {
text1.select();
document.execCommand("copy");
}