JavaScript Code Snippets for Standard VWO Editor operations

Last updated

For every action you perform inside VWO Editor, it generates a JavaScript code snippet. You can modify the generated code snippet to implement changes to the element.editor-57

The following table lists the actions and corresponding code snippets:

Operation JavaScript Code Generated
Move vwo_$(’elementPath’).css({‘position’: ‘absolute’, ‘left’: 10, ‘right’: 20, ‘zIndex’: 10})
Resize vwo_$(’elementPath’).css({‘display’: ‘block’, ‘width’: ‘300px’, ‘height’: ‘100px’, ‘zIndex’: 10})
Show/Hide (Visibility) vwo_$(’elementPath’).css({‘visibility’: ‘hidden’});
Remove vwo_$(’elementPath’).css({‘display’: ‘none’});
Change URL (Images) vwo_$(‘imgPath’).attr({ ‘href’: ‘/new/path’ });
Change SRC (Links) vwo_$(‘anchorPath’).attr({ ‘src’: ‘/new/path’ });
Change CSS (Styling) vwo_$(‘elementPath’).css({‘property1’: value1, ‘property2’: value2..});
Content (Edit) vwo_$(‘elementPath’).html(‘Content to put’);
Content (Edit HTML) vwo_$(‘elementPath’).replaceWith(‘<div>Dummy HTML</div>’);
Change Background Image vwo_$(’elementPath’).css({background-image: ‘url(/images/vwo_logso.png)’});
Paste (Before An Element) vwo_$(‘elementPath’).before(‘<div>Dummy Existing Element to Paste</div>);
Paste (After An Element) vwo_$(‘elementPath’).after(‘<div>Dummy Existing Element to Paste</div>);
Rearrange vwo_$(‘elementPath’).insertBefore(‘elementPath1’);
Custom Code to Remove An Element from Your DOM vwo_$(‘elementPath’).remove();

or

var dev = ‘xyz@example.com’;

alert(dev);

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

Product
Resources Home