javascripthtmlwidgetstockquotestradingview-api

Removing Tradingview logo on Ticker Widget


Can someone please help me remove the tradingview marketing logo. I've tired almost everything and somehow the code get's messed up. I'm using this widget from tradingview (https://www.tradingview.com/widget/ticker/) and wanted to know if:

I am not sure how to go about making it so it can appear on a website.


Solution

  • For removing that, you could inject javascript code into it:

    document.querySelector('.tv-header__link').remove();
    

    tv-header__link is the class of the logo anchor tag...

    The function remove() removes the querySelected element, like the name says.

    MDN Page of remove()

    With querySelector() you can select elements with a certain class or id, so my code selects the element with a class of 'tv-header__link', which is the tradingview-logo in the header, and removes it with the help of the remove() function.

    MDN Page of document.querySelector()

    MDN Page of element.querySelector()