Answers for "how to make hide/show btn in js"

0

how to make hide/show btn in js

let btnName = document.getElementById('btnId');
btnName.addEventListener('click', ()=>{
  let element = document.getElementById('elementId');
	if (element.style.display != 'inline'){
    	element.style.display = 'inline';
    }
  else{
    element.style.display = 'none'
  }
})
Posted by: Guest on July-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language