How do you collect input and store it as a var in html -


this short chunk of code , i'm trying learn html , seems right doesn't work. i'm not sure whats incorrect.

    <!doctype html>     <html>     <head>     <title>         youtube unblocker     </title>     <style>         h1 {text-align:center;}     </style>     </head>     <body bgcolor="#00ff80">      <font color="white" size="7">         <h1>youtube unblocker         </h1>     </font>     <input type="text" id="urllink">      <button type="submit" onclick="getlink()">submit</button>      <script>         function getlink() {             var input = document.getelementbyid("urllink")();             alert(input);         }     </script>     </body>     </html> 

variables in javascript, not in html.

try please:

var input = document.getelementbyid("urllink").value; 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -