Código:
<!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" xml:lang="es" lang="es" dir="ltr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>titulo</title> </head> <script type="text/javascript"> function validar(){ var nombre= document.getElementById("nombre").value; var password= document.getElementById("password").value; //alert(nombre +password); document.getElementById("aca").innerHTML=nombre+" "+password; } </script> <style type="text/css"> label{width:100px; display:inline-block; } </style> <body> <form method="post" action=""> <fieldset> <legend>formulario o_o</legend> <label>Nombre:</label><input type="text" id="nombre" /><br /><br /> <label>password:</label><input type="password" id="password" /><br /><br /> <label></label><input type="button" value="caca" onsubmit="validar()"/> </fieldset> </form> <div id="aca"></div> </body> </html>