I am currently utilizing the following snippet of Javascript to extract information from the current webpage using a browser extension. I have only included a portion of the code that is relevant, as the full script is quite lengthy. The code works perfectly fine and successfully retrieves the company name from the current page. However, I now want this extracted text to appear as a clickable link on the output. I believe I need to modify the element.appendChild(organ); line but I'm unsure of how to turn it into a link. Can you provide some guidance or suggestions on how I can achieve this? Feel free to ask for more details if needed. Thank you in advance.
var enrollmentField = $('input[class="inputField-textBox"]');
var getOrg = $(enrollmentField[0]).val();
var newOrg = "<span class='greyc'>" + getOrg + "</span>";
var organ = document.createTextNode("Organization: ");
element.appendChild(organ);
document.getElementById("myList").appendChild(organ);
$(newOrg).appendTo('#myList');