I use the following code to get the components id:
var tempID = '#{javascript:getComponent("country1").getClientId(facesContext)}'
var re = $('[id='+tempID+']').val();
But after viewing some code inĀ the web i found fast approach to get the documents id by using the pattern in JQuery 's $:
$("[id$=nameofthecomponent]").val()