This website works best with JavaScript enabled. Learn how to enable JavaScript.

How to Add Videos to a Variation Using the Edit HTML Option

Last updated

Videos are more compelling than any other static content on your website. While it reinforces your brand value, videos also motivate the viewers to take action. Using VWO Visual Editor, you can add videos to your website without having to write any code or making changes to the HTML code of the page.

  • Using the Copy and Paste option
  • Adding JavaScript via Code Editor

Using the Copy and Paste Option

  1. Open the webpage in the VWO editor and then select the Copy operation to copy the element to which you want to add the video.editor-39
  2. Paste the copied element where you want to add the video, using the Paste option. While pasting the copied element, you must specify whether to paste it before or after the element (if any) in the targeted section of the page.editor-40
  3. While pasting, you can also choose whether to copy the style of the element or not (per your requirement).editor-41
  4. Next, click on the copied element and select Edit HTML option to add the HTML code snippet of a video.editor-45
  5. In the Edit HTML window, edit the existing HTML code snippet and then add your video to the code.editor-47

Adding JavaScript via Code Editor

For advanced users, the Edit HTML option allows you to directly modify the HTML code snippet of the webpage and add the video using JavaScript.

  • Open VWO Code Editor.
  • Modify the custom script as follows to add the video after a specific element. Make sure to define the selector path of the element after which you will add the video element on the webpage.editor-48

 

Was this article helpful?

Thanks for your feedback!
Please email us at support@vwo.com to tell us what you were looking for. We'll send the answer to your inbox.

Contact Us / Login