Link for code text

by ducrat

HTML

<div class="post-body">Blog chia sẻ trao đổi kinh nghiệm sử dụng Blogger Blogspot, Jquery, Ajax, PHP, <code>Blogger Tutorials</code>, Web Design,...</div>

JavaScript

$(function() {
    $('div.post-body').children('code').each(function() {
        $(this).replaceWith(function() {
            return $('<a href="https://tipscopy.blogspot.com/p/search-results.html?q=' + $(this).text() + '" target="_blank" title="Tìm từ khóa này"><code>' + $(this).html() + '</code></a>');
        });
    });
});