hi all
wollte mal fragen ob des geht bei dieser page goa6.go.funpic.de/
da er automatisch erkent wen text drinne steht er soll dan ein andere background bekommen geht das??
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
| Geschlossen | ||



onfocus="if (value == 's') {value = ''} (background == '#FFF')" onblur="if (value == '') {value = 's'} (background == '#FFF')"

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//DE" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
<title>JS-Demo by pixelmonster.eu</title>
<script type="text/javascript">
function get_focus (id)
{
document.getElementById(id).style.background = '#ff0000';
document.getElementById(id).style.color = '#fff';
}
function lose_focus (id)
{
if(document.getElementById(id).value=='')
{
document.getElementById(id).style.background = '#eee';
}
}
</script>
<style>
input {
background: #eee;
border: 1px solid #ccc;
}
</style>
</head>
<body>
<form action="test.htm" method="post">
<input type="text" id="input_1" name="input_1" onfocus="get_focus('input_1');" onblur="lose_focus('input_1');" /><br />
<input type="text" id="input_2" name="input_2" onfocus="get_focus('input_2');" onblur="lose_focus('input_2');" /><br />
<input type="submit" value="Absenden" />
</form>
</body>
</html>

| Geschlossen | ||
![]() |
Zurück zu HTML, PHP, SQL,... | |