javascript - onmousedown hide/show div -
I want to create a function that hides / shows a div when clicking on a button The ID will be able to pass which I want to hide through the event. But I'm not sure how to do this.
This is what I have done so far:
  & lt; Div onmousedown = "toogleDiv (badge)" & gt; // click here, div id = hide badge Icons v     toogleDiv (id) function {var s = document.getElementById (id ).Style; S.display = s.display === 'None'? 'Block': 'None'; }    Then you use the ID as a string as  togglediv (item)   togglediv (instead of 'item') Can      
 
  
 
Comments
Post a Comment