Skip to content

removePlacement

The removePlacement method removes a previously defined ad placement from Htag. This is useful when you need to dynamically remove ads from the page.

window.htag.api('1').removePlacement(elementId);
  • elementId (string, required): The ID of the HTML element associated with the placement to remove.

Returns the Htag API object, allowing for method chaining.

// Remove a specific placement
window.htag.api('1').removePlacement('div-1');