|
|
|
| Как сделать когда поле пустое то выводилось снова value="e-mail" , я пытался с помочью но чёто не выходит (((
function Text()
if (document.getElementById('email').value == '' )
{
document.getElementById('email').value = 'e-mail';
document.getElementById('email').style.color = 'blue';
}
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Text field</title>
<script type="text/javascript">
function markText()
{
if (document.getElementById('email').value == 'e-mail' )
{
document.getElementById('email').value = '';
document.getElementById('email').style.color = 'blue';
}
}
</script>
</head>
<body >
<input type="text" align="right" id="email" value="e-mail" style="width:88px; color:#FF0000; text-align:center; font-style:italic;" name="email" onclick="markText()"; />
<input type="text" align="right" id="emailt" name="r" />
</body>
</html>
|
| |
|
|