Wrap element by jQuery jQuery(document).ready(function( $ ){ $("#selector > img").wrap($('<a>',{ href: 'https://yourdomain.com' })); });