Skip to main content

Bug Tracker

Side navigation

Ticket #4047: test-4047.html
File test-4047.html, 0.7 KB (added by dmethvin, February 03, 2009 01:58AM UTC)

Working example

<!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>
  <script src="jquery-1.3.1.js"></script>
  
  <script>
  $(document).ready(function(){

$("#testSelect").change(function(){
  alert($("div[id='testDiv'] select[id='testSelect']").val())
  alert($("#testDiv").find("#testSelect").val())
  alert($("#testSelect").val())
});

  });
  </script>
  <style>

  </style>
</head>
<style>

</style>
<body>

<div id="testDiv">
 <select id="testSelect"> 
  <option value="1">One</option>
  <option value="2">Two</option>
 </select>
 <input type="button" id="testBtn" value="Test">
</div> 

</body>
</html>

Download in other formats:

Original Format