Insert href link on existing text: abc, part of a DIV ID: wpfunc01 on a SPS2013 List page. I guess this can be achieved via Jquery.
Please assist with the complete code to insert href on existing text: abc
I got the solution, here is it that may help others in the community -
In the below code, I have modified the TEXT Value: ALL with the same value and added Hyperlink.
<script type="text/javascript">
// Check the main container is ready
$('#WebPartWPQ2').ready(function(){
// Get each div
$('#scriptPagingWPQ2').each(function(){
// Get the content
var str = $(this).html();
// Set the regex string
var regex = /All/ig
// Replace plain text links by hyperlinks
var replaced_text = str.replace(regex, "<a href='http://www.example.com' target='_blank'>All</a>");
// Echo link
$(this).html(replaced_text);
});
});
</script>