HTML DOM Enviar valor de la propiedad
Definición y Uso
propiedad valor establece el botón de valor de la propiedad o valor de retorno se someten. .
valor especificado en la pantalla el texto del botón de confirmación.
gramática
Establecer el valor de la propiedad:
submitObject.value="value"
Devuelve el valor de la propiedad:
submitObject.value
Soporte para el navegador
Todos los principales navegadores soportan valor del atributo
Ejemplos
Ejemplos
El siguiente ejemplo le pide al texto que aparece en el botón de confirmación:
<html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("submit1").value;
alert(x);
}
</script>
</head>
<body>
<form>
Email: <input type="text" id="email">
<input type="submit" id="submit1" value="Submit form">
</form>
<button type="button" onclick="displayResult()">Display value</button>
</body>
</html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("submit1").value;
alert(x);
}
</script>
</head>
<body>
<form>
Email: <input type="text" id="email">
<input type="submit" id="submit1" value="Submit form">
</form>
<button type="button" onclick="displayResult()">Display value</button>
</body>
</html>
Trate »
presentar objetos