Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>val demo</title>
  <style>
  button {
    margin: 4px;
    cursor: pointer;
  }
  input {
    margin: 4px;
    color: blue;
  }
  </style>
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
 
<input type="text" name="t" value="click a button">
  <br/>
<input type="radio" name="r" value="10">
  <input type="radio" name="r" value="20">
  <br/>
<input type="radio" id="r21" name="r2">
  <input type="radio"  id="r22"  name="r2">
  <br/>
 <input type="checkbox" name="c1" value="50">
  <input type="checkbox" name="c2" >
  <br/>
 <select name="s">
   <option>o1</option>
   <option>o2</option>
   <option>o3</option>
  </select>
<br/>
 <select name="s2">
   <option value="10">o1</option>
   <option value="20">o2</option>
   <option value="30">o3</option>
  </select>
  
<script>
  $( "[name=t]" ).val( "texto" );
  $( "[name=r]" ).val( ["20"]);
  $( "#r21" ).prop("checked", true );
  $( "[name=c1]").val( ["50"] );
    $( "[name=c2]").prop("checked", true );
  $( "[name=s]").val( "o2" );
  $( "[name=s2]").val( "30" );
</script>
 
</body>
</html>
Output

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

Dismiss x
public
Bin info
syteluspro
0viewers