Skip to content
Advertisement

Remove tag using javascript

Is there a way to remove title tag using javascript?

I tried to do this

JavaScript

but it failed because title tag is not a node (console said). I need to force a WordPress plugin to overwrite the default title tag with a custom one.

Any ideas?

Advertisement

Answer

The title property just contains a string representation of the title. It doesn’t represent the element itself.

You can use any of the usual methods to get the element itself.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement