Jump to content

Form title in field script question


tommr

Recommended Posts

Although I don't know how they did the fade-out, (ajax?) this may work:

<html>
<head>
<script type="text/javascript">
function changeColor(color) {
    document.getElementById('x').style.color=color;
}
function clearDefault(el) {
  el.value = ""
}
</script>
</head>

<body>

<form>
    <input id="x" onmousedown="changeColor('red')" onkeydown="clearDefault(this)" type="text" value="field text" size="20">
</form>

</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.