I'm trying to build a website using jquery-1.10.2 where I want to replace css related strings like <style>, <link> etc. with comment string <!-- -->.So far I've managed to replace them by <!-- but I can't find a way to add --> by regex since I'm noob about regex. Here are my codes,
$(document).ready(function () {
$('#btnUpdate').click(function () {
$('#divText').val($('#divText').val().replace(/<\/?style.*?>|<\/?link.*?>/, "<!--"));
});
});
How can I add --> after the last string? Need this help badly. Thanks.