Adding a _blank tag with Javascript in Divi

I’ve built and maintain four corporate websites for my employer, and since the change to Gutenberg, the premium theme I chose, Divi by Elegant Themes, has been slow and cumbersome to use. Some features don’t work at all requiring a workaround.

One such feature was adding _blank to a button. I checked the box to “open in new tab” but couldn’t get the feature to work.

I used the inspector tools in Firefox to find the exact div and then added this text below in the head section. You get to the <head> by going into the theme options. This was someone else’s workaround that I adapted to my needs. I’m including it here hoping it helps someone else.

Pay it forward, nerds.

Text in head section of integrator:

<script type=”text/javascript”>
jQuery(“.et_pb_button.et_pb_promo_button”).attr(‘target’, ‘_blank’);});