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:

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

This post may contain referral links which may earn a commission for this site

Divi Booster

Hundreds of new features for Divi
in one easy-to-use plugin

2 Comments

  1. Merci c'est que je recherchais !

    Reply
    • You're very welcome, Exocet-Web!

      Reply

Submit a Comment

Your email address will not be published.