Перенести ссылку из одного <a> в другой!
Всем здрасте!
Нужна помощь. Есть такой код: <div class="wf-cell"> <div> <div class="text-big"> <div class="wf-table"> <div class="wf-td"> <a href="/website-integration"> <!--нужно копировать эту ссылку--> <img src="img.jpg" alt=""></a> </div> <div class="wf-td benefits-inner"> <h4>Website Integration</h4> <!--вставить сюда тег a ссылкой выше--> <p>This feature allows you to bind Sugar and your website altogether with only few clicks and enjoy the benefits of your newly created recruitment portal.</p> </div> </div> </div> </div> </div> Вот, но есть одно но, таких блоков много и в каждом своя ссылка на картинке. Нужно чтобы в каждом таком блоке вставлялся тег <a> с ссылкой выше в заголовок <H4>!!! Помогите это реализовать! |
Цитата:
<!DOCTYPE html> <html> <head> <meta http-equiv='Content-Type' content='text/html; charset=windows-1251' /> <script src='http://code.jquery.com/jquery-latest.js'></script> <!-- <script src="https://code.angularjs.org/1.3.9/angular.min.js"></script> <script src="https://code.angularjs.org/1.3.9/angular-route.js"></script> <link rel='stylesheet type=text/css href=tmp.css' /> <link rel="stylesheet/less" type="text/css" href="style.less"> <script src="http://cdnjs.cloudflare.com/ajax/libs/less.js/2.5.0/less.min.js"></script> --> <style type='text/css'> </style> <script type='text/javascript'> $(function(){ $('.wf-cell a').each(function(){ $(this).parents('.wf-table').find('h4').append($(this).clone()); }); }); </script> </head> <body> <div class="wf-cell"> <div> <div class="text-big"> <div class="wf-table"> <div class="wf-td"> <a href="/website-integration"> <!--нужно копировать эту ссылку--> <img src="http://javascript.ru/forum/images/smilies/smile.gif" alt=""></a> </div> <div class="wf-td benefits-inner"> <h4>Website Integration</h4> <!--вставить сюда тег a ссылкой выше--> <p> This feature allows you to bind Sugar and your website altogether with only few clicks and enjoy the benefits of your newly created recruitment portal. </p> </div> </div> </div> </div> </div> <div class="wf-cell"> <div> <div class="text-big"> <div class="wf-table"> <div class="wf-td"> <a href="/website-integration"> <!--нужно копировать эту ссылку--> <img src="http://javascript.ru/forum/images/smilies/laugh.gif" alt=""></a> </div> <div class="wf-td benefits-inner"> <h4>Website Integration</h4> <!--вставить сюда тег a ссылкой выше--> <p>This feature allows you to bind Sugar and your website altogether with only few clicks and enjoy the benefits of your newly created recruitment portal.</p> </div> </div> </div> </div> </div> </body> </html> |
Часовой пояс GMT +3, время: 22:04. |