0

i'm using

var btn = dom.byId("portAid");
btn.innerHTML=omsportAid;
btn.style.fontWeight = 'bold';

How to remove/hide the div(portAid)?

Tamil Selvan C
  • 19,913
  • 12
  • 49
  • 70
user3271040
  • 79
  • 1
  • 1
  • 8

2 Answers2

0

Possible duplicate: Remove element by id

var element = document.getElementById("portAid");
element.parentNode.removeChild(element);
Community
  • 1
  • 1
WoutVanAertTheBest
  • 800
  • 1
  • 16
  • 33
0

To remove it:

btn.style.display="none";

Or to simply hide it:

btn.style.visibility="hidden";

The difference is that with visibility: hidden the component will still take up space, but it will be invisible. Display:none removes the component and collapses the other components that surround it on the now empty space.

Chad
  • 164
  • 10