Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6225067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:46:43+00:00 2026-05-24T08:46:43+00:00

I used Jquery to have many dynamically generated feedback lines to quiz questions coming

  • 0

I used Jquery to have many dynamically generated feedback lines to quiz questions coming from an xml. Sample:

You answered (Yes.) Your patient is at moderate to high risk.
You answered (No.) Your patient is at low to high risk.
You answered (Weekly Dose.) Your patient is at moderate risk.
etc.

How can I find and format different parts of the feedback text? I need to format part of the text with the quotation marks in italic. Also format part of text at the end in bold starting with the word “at” till the period mark?

I guess it would be possible with regular expressions but I haven’t used them.
so far I have the following:

var feedbackString = "<p id='feedbackTxt'>" + currentQuizNode.find("Feedback").text() + "</p>";
$("#quizFeedback").append(feedbackString);

Thank you in advance,
Attila

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:46:44+00:00Added an answer on May 24, 2026 at 8:46 am
    var feedbackString = "<p id='feedbackTxt'>" + 
      currentQuizNode.find("Feedback").text().
        replace(/"(.*)"/, "<span style='font-style: italic;'>$1</span>").
        replace(/(\bat\b.*?\.)/, "<span style='font-weight: bold;'>$1</span>") + 
        "</p>";
    $("#quizFeedback").append(feedbackString);
    

    If you meant to say parenthesis instead of quotation marks then change:

    replace(/"(.*)"/, "<span style='font-style: italic;'>$1</span>").
    

    To:

    replace(/(\(.*?\))/, "<span style='font-style: italic;'>$1</span>").
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used jQuery's jqrte text editor, but it has many drawbacks. Could anyone
I have used JQuery for a small animation work: a table #photos contains 9
I have used JQuery within my asp.net page. JQuery is working fine. I could
I am working on some website , i have used jQuery UI , for
I have not used jquery much yet and not very familiar with it. Trying
can somebody tell me what is jQuery plugin? I have used the jQuery library
I like jQuery and I was wondering if anyone have used a good plugin
I have some onchange events setup in jQuery which are used to populate a
I have always used the mouseover event, but while reading the jQuery documentation I
I'm new to building jQuery plugins. I have seen and used a lot of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.