Home > Enterprise >  Wordpress how to modify <body> tag of a page by adding extra html attributes
Wordpress how to modify <body> tag of a page by adding extra html attributes

Time:11-04

In wordpress is there a way to set the body tag attribute on a Page like this :

<body onBlur="window.focus()">

WP Block editor does not allow editing the page html, because it is visual editor of course.

I use this code so I can make a popup window stay always on top.

BTW I solved the problem how to popup the window, just dont know how to make it stay on top

enter image description here

CodePudding user response:

What do you mean with "on top"? Are you talking about the z-index? If yes, then use css. Otherwise with JavaScript you can manipulate every single element on your page. https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute

  • Related