removePlacement
Overview
Section titled “Overview”The removePlacement method removes a previously defined ad placement from Htag. This is useful when you need to dynamically remove ads from the page.
Syntax
Section titled “Syntax”window.htag.api('1').removePlacement(elementId);Parameters
Section titled “Parameters”- elementId (string, required): The ID of the HTML element associated with the placement to remove.
Return Value
Section titled “Return Value”Returns the Htag API object, allowing for method chaining.
Example
Section titled “Example”// Remove a specific placementwindow.htag.api('1').removePlacement('div-1');Related Methods
Section titled “Related Methods”- definePlacement: Define ad placements