href and jquery problem

href and jquery problem

  1. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  2. <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js"></script>
  3. <script type="text/javascript">
  4. $(document).ready(function(){
  5.     
  6.     $('#action').hide();
  7.     $('#open_hover').click(function(){
  8.         $('#action').fadeIn(500);
  9.         var order_id = $('#open_hover').attr('href');
  10.        $('#action_content').append('<p>'+order_id+'</p>'); 
  11.         
  12.         
  13.     });
  14.     
  15. });

  16. </script>

  17. <style>
  18. #action{
  19.     position:absolute;
  20.     margin-top: 20%;
  21.     margin-left: 10%;
  22.     padding:10px;
  23.     
  24.     width:340px;
  25.     
  26.     border:3px solid maroon;
  27.     
  28.     border-radius:5px;
  29.     -moz-border-radius:5px;
  30.     background:pink;
  31.     
  32. }
  33. #action #action_content {float:left; font-size:12px}
  34. </style>
  35. <div id="action">
  36.     <div id="action_content">Order ID: </div>
  37. </div>


  38. <?php 
  39. $x=0;
  40. $total_link = 10;
  41. while($x<$total_link){
  42.     $x++;
  43. ?>
  44. <li><a href="#<?php echo $x; ?>" id="open_hover" rel="view">View <?php echo $x ;?></a></li>
  45. <?php } ?>

Hi all.

The link should open a red box.
im not sure why my 2nd link (and the rest) didnt work. Only the 1st link work as expected.