Jump to content
Fórum Script Brasil
  • 0

Receber INPUT HIDDEN no Javascript


BRKAW

Question

Olá Pessoal! Como estão?

Seguinte, queria uma coisa bem básica e fácil!

Eu teria na minha página um INPUT HIDDEN e eu queria que o javascript recebesse o value do meu input hidden....

Por exemplo:

<input type="hidden" name="hidden" value="LALALA">

<script type='text/javascript'>
   Aqui o javascript recebe o valor que esta a cima no input em joga em uma váriavel do javascript...
</script>

Galeraa muito obrigado desde já!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>teste</title>

<script>

function get(){

alert( document.getElementById('t').value );

}

</script>

</head>

<body>

<input type="hidden" name="t" id="t" value="Campo oculto">

<input type="button" value="Pegar valor do campo oculto" onClick="java script:get();">

</body>

</html>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652.1k
×
×
  • Create New...