para obtener o añadir dicho valor en el campo de texto realizo esta sentencia pero a partir de ahi no se como continuar: saludos...
Código: Seleccionar todo
var valor=document.getElementById("nombre").value;
Código: Seleccionar todo
var valor=document.getElementById("nombre").value;
Código: Seleccionar todo
function texto_valor(datos) {
document.getElementById("nombre").value="";
document.getElementById("apellido1").value="";
}
onfocus="texto_valor(id);
Código: Seleccionar todo
var valor = document.getElementById("nombre").value;
Código: Seleccionar todo
document.getElementById("nombre").value = "";
Código: Seleccionar todo
function borrar_nombre() {
document.getElementById("nombre").value = "";
}
function borrar_apellido1() {
document.getElementById("apellido1").value = "";
}
Código: Seleccionar todo
function borrar_elemento(elemento) {
document.getElementById(elemento).value = "";
}
Código: Seleccionar todo
onfocus='borrar_elemento("nombre")'
onfocus='borrar_elemento("apellido1")'
Código: Seleccionar todo
function borrar_elemento(elemento) {
document.getElementById("elemento").value = "";
}
//y esta linea en cada elemento:
onfocus='borrar_elemento("nombre")'
onfocus='borrar_elemento("apellido1")'
Código: Seleccionar todo
function borrar_elemento(elemento) {
document.getElementById("elemento").value = "";
}
Código: Seleccionar todo
function borrar_elemento(elemento) {
document.getElementById(elemento).value = "";
}
Código: Seleccionar todo
function borrar_elemento(elemento) {
alert("He entrado con el parámetro:");
alert(elemento);
document.getElementById(elemento).value = "";
}
Código: Seleccionar todo
function chívate (texto) {
alert (texto);
alert ("texto");
}
/* Lo siguiente son las llamadas a la función */
chívate ("caca"); /* Caso 1 */
chívate ("hola"); /* Caso 2 */
Código: Seleccionar todo
document.getElementById(elemento).onfocus=borrar_elemento;
Código: Seleccionar todo
document.getElementById(elemento).onfocus = function(){ borrar_elemento(elemento); };
Código: Seleccionar todo
function borrar_elemento(elemento){
document.getElementById(elemento).value = "";
document.getElementById(elemento).style.backgroundColor= "#F6FFA9";
document.getElementById(elemento).style.border= "2px solid #e6b700";
document.getElementById(elemento).onfocus = function(){ borrar_elemento(elemento); };
}