Intanto - per recuperare - potresti far già stampare da PHP il gestore d' evento ONCLICK con relativo invoco di una funzione; nel tag dell' Elemento che ti incasella questi dati.
Nel mio esempio sono TD ma potrebbero anche essere DIV o LI ..
Il fatto è che .innerHTML ti recupera tutto il contenuto, anche tag di formattazione se hai <Paolo> nella lista; no per quanto riguarda le formattazione assegnate tramite CSS (anche in-line css).
codice:
<script>
function recupera(dato){
document.getElementById("campo").value=dato;
}
</script>
<input id="campo">
<table border="1"><tr>
<td onclick="recupera(this.innerHTML)">01</td>
<td onclick="recupera(this.innerHTML)">Enzo</td>
<td onclick="recupera(this.innerHTML)">SIMONELLI</td>
</tr><tr>
<td onclick="recupera(this.innerHTML)">02</td>
<td onclick="recupera(this.innerHTML)">Mario</td>
<td onclick="recupera(this.innerHTML)">FERRARI</td></tr>
</table>