Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <label>zero</label>
  <label>one</label>
  <input id="substance">
  <label>two</label>
  <label>three</label>
  <input name="atc_code">
  <script>
    $('input#substance').prevAll('label').first().add(
      $('input[name="atc_code"]').prevAll('label').first()
    ).css("color", "green");
  </script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers