Avatar of Mark Branscum
Mark Branscum
Flag for United States of America asked on

Jquery Bold 3 specific words in a paragraph

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
jQuery* divWeb Development

Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon
Mark Branscum

ASKER
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:
ASKER CERTIFIED SOLUTION
Julian Hansen

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Julian Hansen

Here is a sample that demonstrates the solution above
Mark Branscum

ASKER
Loved the example you sent me too .... well done and so simple too
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Julian Hansen

You are welcome.