<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Документ без названия</title>
<style type="text/css">
#apDiv1 {
position:absolute;
left:38px;
top:14px;
width:315px;
height:74px;
z-index:1;
}
#apDiv2 {
position:absolute;
left:43px;
top:100px;
width:239px;
height:42px;
z-index:2;
}
</style>
<script>
function polushenie(event)
{
event = event || window.event;
var t = event.target || event.srcElement;
if (event.stopPropagation) event.stopPropagation();
else event.cancelBubble = true;
if (event.preventDefault) event.preventDefault();
else event.returnValue = false;
if (t.id=="ssilka") document.getElementById("inp").value=t.innerHTML;
}
function perehod(event)
{
event = event || window.event;
var t = event.target || event.srcElement;
if (event.stopPropagation) event.stopPropagation();
else event.cancelBubble = true;
if (event.preventDefault) event.preventDefault();
else event.returnValue = false;
if (t.id=="inp") document.getElementById("apDiv1").style.display="";
}
function skr()
{
document.getElementById("apDiv1").style.display="none";
}
</script>
</head>
<body onclick="skr()">
<div id="apDiv1"><a href="#" id="ssilka">нажми </a></div>
<div id="apDiv2"><input id="inp" type="text"/></div>
<script>
document.getElementById("apDiv1").style.display="none";
if ( document.attachEvent )
{
document.getElementById("apDiv1").attachEvent ( 'onclick',polushenie, false );
document.getElementById("inp").attachEvent ( 'onkeyup',perehod, false );
}
else
{
document.getElementById("apDiv1").addEventListener("click",polushenie, false);
document.getElementById("inp").addEventListener("keyup",perehod, false);
}
</script>
</body>