How to add span tag inside Divi Contact Form module submit button

I am building a contact form using the divi builder's module. Divi's contact form already comes with a button and I need to customize it by adding html span tags within the button tag.

.link--button {
  font-family: "Raleway", sans-serif;
  font-size: 15px;
  line-height: 22.6px;
  background-color: transparent;
  padding: 16px 32px 16px 40px;
  cursor: pointer;
  border: 4px solid #000000;
  color: #000000;
}

.link--button:hover .arrow {
  transition: all 0.4s ease;
  width: 35px;
  margin-right: 5px;
}

.arrow {
  height: 2px;
  width: 25px;
  position: relative;
  display: inline-block;
  cursor: pointer;
  margin-right: 15px;
  margin-bottom: 4px;
  background: black;
}

arrow:before {
  right: -2px;
  bottom: -3px;
  transform: rotate(-45deg);
  background: black;
}

.arrow:after {
  right: -2px;
  top: -3px;
  transform: rotate(45deg);
  background: black;
}

.arrow:before,
.arrow:after {
  content: "";
  background: black;
  position: absolute;
  height: 2px;
  width: 10px;
  border-radius: 30%;
}
<button class="link--button btn--black">
  <span class="arrow arrow--black"></span>Submit
 </button>

How can I modify divi's html to insert the arrow?

1 answer

  • answered 2021-06-18 19:15 Carolina Klein

    I found the answer. In the Divi Themes integration tab, use jquery to prepend the HTML as so:

    jQuery(document).ready(function(){
        jQuery(".my-form .et_pb_button").prepend('<span class="arrow arrow--black"></span>');
    });
    

    This adds the HTML tag inside of the form's button