Well, I am digressing from the question, but I had a similar need today and though I couldn't find the ID from the client using Javascript, I did the following.
On the server side: -
<div style="display:none;visibility:hidden" id="uip"><%= Request.UserHostAddress %></div>
Using Javascript
var ip = $get("uip").innerHTML;
I am using ASP.Net Ajax, but you can use getElementById instead of $get().
What's happening is, I've got a hidden div element on the page with the user's IP rendered from the server. Than in Javascript I just load that value.
This might be helpful to some people with a similar requirement like yours (like me while I hadn't figure this out).
Cheers!