Jquery Bold 3 specific words in a paragraph

Mark Branscum
Mark Branscum used Ask the Experts™
on
at the moment I have
 
$(document).ready(function() {
    $(".meIntro p:contains('Name:')").css("font-weight", "bold");
   
});

Open in new window

But this makes bold the entire paragraph not the word ........
What I need is 3 specific words .. Name: Location: Skills: to be Bold

Also note ... this paragraph is the 3rd paragraph in a div with a class called meIntro

I need this to happen when document.ready
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mark BranscumWeb Developer

Author

Commented:
Ok still searching this out ...... found this and I modified it a bit but it does work ...... honestly I do not fully understand it but hey guys jquery is new and I am learning

$(document).ready(function() {
    $(".meIntro p").each(function() {
        $(this).html($(this).html().replace(/Name:/g, "<strong>Name:</strong>"));
    });
   

});

Open in new window


This does what I want for one word can it be modified for 3 words .... Name:    Location:   Skills:
Most Valuable Expert 2017
Distinguished Expert 2018
Commented:
This should do what you are looking for
<script>
$(function() {
    $(".meIntro p").each(function() {
        $(this).html($(this).html().replace(/(Name:|Location:|Skills:)/g, "<strong>$1</strong>"));
    });
});
</script>

Open in new window

Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Here is a sample that demonstrates the solution above
Mark BranscumWeb Developer

Author

Commented:
Loved the example you sent me too .... well done and so simple too
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
You are welcome.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial