function moo(theId) {$("#idNumber" + theId).text("does this work?");}
<div id="idNumber384">hi 384</div>
<a onclick="moo(384)">Get 384</a>