The CreatorCon Call for Content is officially open! Get started here.

DOM manipulation alternative for Catalog Client Script

Lucy17
Kilo Contributor

After removing iFrame from catalog items and changing all the UI types to "All" on catalog client scripts, there are a bunch of DOM manipulation that is not supported anymore. Is there a similar method to getElementById of an button and change its style and is there a way to manipulate the innerHTML?

6 REPLIES 6

Community Alums
Not applicable

See if you can do something with a timeout and form controls.

I've used this successfully in the past to alter label styles.

function onLoad(){

  setTimeout(function(){

    if(window != null){
      g_form.getControl('My Label Here').setAttribute('style','display:none');
    }else{
      var tags = this.document.getElementsByClassName('ng-binding');
      var searchText = 'My Label Here';
      for(var i=0; i<tags.length; i++){
        if(tags[i].textContent.toString() == searchText){
          tags[i].style.display = 'none';
        }
      }
    }


  },3000);


}

Alternatively try "this" in front of .document

function onLoad(){

  this.document.getElementById("IDHere").style.display = none;

}

krishna134
Giga Contributor

You can try using 

var requiredElement = top.document.getElementsByTagName('')

to get the element in the catalog and have your DOM Manipulation.