Focus on the Divi Password Box module on load


Divi Password Box lets you style password protected pages using the Divi Builder. Here's how to ensure that the cursor is focused in the password box module's password field when the page loads.

You should be able to do it by adding the following JavaScript to your site:

/* Focus on password box module, if present */
if (document.querySelector) {
	var passwordBox = document.querySelector(".et_pb_dbpp_page_password_password");
	if (passwordBox) {
You can add it in the "Divi > Theme Options > Integration > Add code to the < body >" box.


  1. Merci c'est que je recherchais !

    • You're very welcome, Exocet-Web!


Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

Your email address will not be published. Required fields are marked *.

We may earn a commission when you visit links on our website.