Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/03/2012, 06:24
nilburcion
 
Fecha de Ingreso: diciembre-2011
Mensajes: 98
Antigüedad: 12 años, 4 meses
Puntos: 29
Respuesta: ¿Alguien puede ayudarme? (Javascript básico)

Toma aquí tienes tu código:
Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
function modifyText() { 
 var fecha=new Date();
document.getElementById("date").innerHTML=fecha.toLocaleDateString(); 
}

</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>index</title>
<link rel = "stylesheet"
type = "text/css"
href = "myStyle.css" />
<script type = "text/javascript" src = "javaScript.js"></script>
</head>
<body id = "principalDesign">
<div id = "all" class = "borde">
<button type = "button" id = "fecha" class = "borde" onclick="javascript:modifyText()">Muestra la fecha</button>
<div id = "date" class = "borde textAlign">
</div> 
</div>
</body>
</html>