Изучаю_JS,
<!DOCTYPE html>
<html>
<body>
HOSTIP:
<div class="hostip">тут мой текст</div>
IDNAME:
<a id="idname" href="http://google.com/search?q=" >поиск</a>
<script type="text/javascript">
var tag_arr = document.getElementsByTagName('div');
for(ti=0;ti<tag_arr.length;ti++) {
if (tag_arr[ti].className == 'hostip') {
tag_arr = tag_arr[ti]; break;
}
}
document.getElementById('idname').href += tag_arr.innerHTML;
</script>
</body>
</html>