I would like an automatic popup box to open after the user spends 10 seconds on the page. This is the JavaScript code that I have so far in my HTML document. What can I add to it to make the box appear after 10 seconds?
<script type = "text/javascript">
var modal = document.getElementById('myModal');
var span = document.getElementsByClassName("close")[0];
window.onload = function () {
modal.style.display = "block";};
span.onclick = function() {
modal.style.display = "none";};
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";} }
</script>