element.style.display='none' seems not working in UI Macro

Yu_G
Tera Contributor

Hi everyone,

 

I tried to hide a standard search icon by element.style.display = 'none' in UI Macro but it is not working.

Is it impossible to hide a standard icon or am using a wrong method?

 

Thank you so much.

2 REPLIES 2

Harneet Sital
Mega Sage
Mega Sage

Hi @Yu_G , is this for a normal field on your form? If so, you can use the mentioned attribute to hide the search icon and there is no need to amend the UI macro. 
Here is an article that can help you : 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0714705 

Thank you for your help.

I noticed that this article is about reference icon ⓘ , will it also works for search icon (maginified glass)of a reference field?

In addittion, somehow i managed to delete the search icon by using parentNode.removeChild. But am confused why element.style.display = 'none' is not working in this case.