Показать сообщение отдельно
  #1 (permalink)  
Старый 07.10.2014, 19:51
Интересующийся
Отправить личное сообщение для walhoda Посмотреть профиль Найти все сообщения от walhoda
 
Регистрация: 07.10.2014
Сообщений: 12

Таблица и Переменные
<!Doctype html>
<html>
<head>
<title> человек </title>
<meta http-equiv="Content-Type"content="text/html; charset=windows-1251">
</head>
<body onload="paste()" >
<table border="4" width="500" height="100">
<tr>
<td align="center" >
Имя
</td>
<td align="center">
Фамилия
</td>
<td align="center">
Возраст
</td>
<td align="center">

</td>
</tr>
<tr>
<td id="id_1" align="center">
</td>
<td align="center">
</td>
<td align="center">
</td>
<td align="center">
</td>
</tr>
</table>
<script type="text/javascript" >
function paste()
{
document.all.id_1.innerHTML=name



function person (name, surhname, age, phone)
{
this.name=name
this.surhname=surhname;
this.age=age;
this.phone=phone;
this.getInfo=getInfo;
return this;
}

function getInfo()
{
alert("Имя:"+this.name+"\nФамилия:"+this .surhname+"\nВозраст:"+this.age+"\nТеле фон:"+this.phone);
}

var man=new person("Валентин","Хода", "14","55-22-94");
man.getInfo();

izmenino=confirm("Вы хотите изминить данные?")
if (izmenino)
{
function person_izmenino (name, surhname, age, phone)
{
this.name=prompt("Введите имя:");
this.surhname=prompt("Введите фамилию:")
this.age=prompt("Введите возраст:")
this.phone=prompt("Введите :")
this.getInfo=getInfo;
return this;
}
function getInfo()
{
alert("Имя:"+this.name+"\nФамилия:"+this .surhname+"\nВозраст:"+this.age+"\nТеле фон:"+this.phone);
}
var man_izmenino=new person_izmenino(getInfo)
man_izmenino.getInfo();
}
else
alert("Нажмите ОК чтобы выйти")
}
</script>
</body>
</html>
Как мне перемести эти переменные в таблицу чтобы в ячейки все данные заполнить:
this.name=name
this.surhname=surhname;
this.age=age;
this.phone=phone;
this.getInfo=getInfo;
Ответить с цитированием