how to set timeout for a div tag in html

Solutions on MaxInterview for how to set timeout for a div tag in html by the best coders in the world

showing results for - "how to set timeout for a div tag in html"
Maddison
11 Nov 2017
1<script>
2  const timeout = document.getElementsByClassName('classname')
3  setTimeout(hideElement, 1000) //milliseconds until timeout//
4  function hideElement() {
5    timeout.style.display = 'none'
6</script>
7<div class="classname">
8  <span> &times; </span>
similar questions
queries leading to this page
how to set timeout for a div tag in html