Answer the question
In order to leave comments, you need to log in
How to do 2 actions on a button?
Tell me how, when you click on the button, to download the file and open a popup on the site.
The download button itself:
<div class="btn" onclick="location.href='file.xlsx';">Скачать</div>
<div class="btn-b" data-fancybox data-animation-duration="700" data-src="#Modal" href="javascript:;">Открыть</div>
Answer the question
In order to leave comments, you need to log in
document.querySelector('.btn-b').addEventListener("click", function(){location.href='file.xlsx'})
div
=(<div class="btn-b" data-fancybox data-animation-duration="700" data-src="#Modal" href="javascript:;">Открыть</div>
<script>
document.querySelector('.btn-b').addEventListener("click", function(){location.href='file.xlsx'})
</script>
document.querySelector('.btn-c').addEventListener("click", function(){location.href='file.xlsx'})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question