Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Add to list</title>
  <meta name="keywords" content="" />
  <meta name="description" content="" />
  <meta name="author" content="Frederic Vandeborne" />
  <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  
  <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  <script type="text/javascript" src="main.js"></script>
</head>
<body>
  
  <div id="container">
    <form action="" method="post" id="values">
      <fieldset>
        <label for="text">Value: </label>
          <textarea name="text" cols="10" rows="10"></textarea>
  
        <br />
  
        <input type="submit" value="add" />
      </fieldset>
    </form>
  
    <ul id="list">
    </ul>
  
  </div>
  
</body>
</html>
 
function addValue(e) {
  $("#list").append("<li>" + $("#values textarea").val() + "</li>");
  $("#values textarea").html("");
  return false;
}
function init() {
  $("#values input[type=submit]").bind("click", addValue);
}
$(document).ready( inits )
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers