Change text function

This little function will change the text based on the answer of a previous question.

function Complaint(qid)
{
            //set default question text
            var txt = “”;
            //change question text if rating question is equal to 1
            if(f(qid).any(‘1’)) { txt = “Please confirm what the nature of the complaint was, when it was made, what action was taken, by who and when”; }
  if(f(qid).any(‘2’)) { txt = “Please confirm what the nature of the complaint was, when it was made, what action needs to be taken now, by who and by when”;}
            return txt;
}
In the question you want to display either text use the code – ^Complaint(‘qnr_complaint’)^