in the community, we have a standard detail page where we want to restrict customer to update the status field what we have done until are following.
CSS by a hierarchy of dom inside aura HTML but failed when the client changed the position of the field.
we tried on inner HTML
var elements = document.getElementsByClassName("uiPicklistLabel"); console.log(elements); for(var x=0; x < elements.length; x++) { console.log(elements[x]); if(elements[x].children[0].innerHTML="Status"){ console.log(elements[x].children[0].innerHTML); elements[x].nextSibling.classList.add("statusactivecss"); } }
and add CSS to added class.
it's working fine while direct use in the console but in ltng:require scripts=
DOM change later when we click edit and again fail to hide any suggestion related to this