How to copy selected items from multi-level list to text box

I am creating a small troubleshooting guide which is created in Jquery and HTML. When user selects a step this is designed to give next step to try and from there next one in a flow chart style.

I want to add a textbox to which the selections will auto populate. After troubleshooting they should be able to copy all selected items from the text box. Can anyone help me with a code which will auto populate all user selected items from the flow into a text box.

Please find the code I used for the selection area and text box. Any help will highly appreciated… Thanks in advance…

var count = 0;
$(‘#questions tr:nth-child(2)’).attr(‘id’,‘currow’);
var q1 = $(‘#currow td:nth-child(2)’).html();
var q3 = ‘<div id="d’ + count + ‘"><p>’ + q1 + ‘</p>’ ;
var a1 = $(‘#currow td:nth-child(3)’).html();
var r1 = q3 + a1 +‘</div>’;

var target = $(this).attr(‘id’);
var parid = $(this).parent().parent().attr(‘id’);
var parnum = parseInt(parid.slice(1,3));
count = count + 1;
var ps = $(‘#showquestion div’).length;
$(‘#showquestion div’).each(function() {
var divid = $(this).attr(‘id’);
var divnum = parseInt(divid.slice(1,3));
if(divnum > parnum)
$(‘td’ ).each(function(){
var qnum = $(this).text();
if(qnum == target) {
var q = $(this).next(‘td’).html();
var q2 = ‘<div id="d’ + count + ’ "><p>’ + q + ‘</p>’;
var a = $(this).next(‘td’).next(‘td’).html();
var qs = $(‘#showquestion’).html();
var r = qs + q2 + a +‘</div>’;

<div class=“luiTitle”><a href=“” style=" text-decoration:none; color:#bbb">Support System </a></div>

<div id=“showquestion” class=“answers”></div>

<table width=“50%” border=“0” cellspacing=“1” cellpadding=“2” id=“questions” >
<td>Question/Heading </td>
<td>Answers </td>

<td>Question 1</td>
<li id=“2”>Option 1</li>
<li id=“3”>Option 2</li>
<li id=“4”>Option 3</li>

<td>Level 2 - from question 1 Option 1</td>
<li id=“5”>Option 1</li>
<li id=“6”>Option 2</li>

<td>Level 2 - from question 1 - no</td>
<li id=“9”>Option 1</li>
<li id=“10”>Option 2</li>
<li id=“6”>Option 3</li>
<li id=“7”>Option 4</li>
<td>Level 3 - from level 2 option 1</td>
<li id=“11”>Option 1</li>
<li id=“12”>Option 2</li>
<li id=“13”>Option 3</li>
<li id=“13”>Option 4</li>

<!-- I want the selected questions to autopulate in the below text box–>
Text Field: <input type=“text” id=“textbox” /><br />