少し異なりますが以下の方法はどうでしょう? <input type=text onclick=FocusIn(this) onBlur=ForcusIn(this)> function FocusIn(i){ for(n=0;n<document.formName.elements.length;n++){ if(i==document.formName.elements[n]){ FORCUS=n; } } FORCUS=n; } そしてクリックする場所を <A HREF=# onclick=ValueIn('value')>INPUT</a> function ValueIn(i){ n=FORCUS; document.formName.elements[n].value=i; } とすればいいのではないでしょうか?
![クリック→フォーカスのある場所に文字を挿入](https://cdn-ak-scissors.b.st-hatena.com/image/square/96b6f7e41f80711497997e6f0a65ab362eda9904/height=288;version=1;width=512/https%3A%2F%2Foshiete.xgoo.jp%2Fimages%2Fsp%2Fqa_recommend%2F2101_3.jpg)