Show it "the same way I did"? Do you mean in a disabled select box? If so, then sure you can.
function showPrefix(o) {
var d = document;
var sPref = d.getElementById('prefix');
sPref.selectedIndex = o.selectedIndex;
d.getElementById('hiddenPrefix').value = sPref.value;
}
But having a disabled control that can't ever be enabled seems counterintuitive to me. I'd go with rincewind's suggestion on how to display the prefix. If you don't like his approach of having <option value="[prefix]">[country]</option>, you can of course combine the code in this post with his.
If you don't like the extra button click
'<select id="country" name="country" onchange="codeDisplay()">'
var codeDiv = document.getElementById("codeDisplay");
removeChildNodes(codeDiv); // Add this line here
codeDiv.appendChild(para);
And then you can also remove the function removeElement.
Furthermore, this piece of code always evaluates to false, so it can be removed
if(para=='p'){
para.removeChild(txt);
}
And finally, to avoid "Country code is: " (when "Select" is selected)
var codeDiv = document.getElementById("codeDisplay");
removeChildNodes(codeDiv);
if (document.getElementById('country').selectedIndex == 0)
return;
codeDiv.appendChild(para);