Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
<div id="pagination65" class="pagination">Link 1</div> <!-- genereate by php function -->
<div id="pagination26" class="pagination">Link 2</div> <!-- same with different number at end -->
<div class="col-bottom-2">
  <div class="ui-body" style="background-color: #FCFCFC;"> <!-- This is div here I need append those div with same ID as href number in link below -->
    <h2 class="main" style="color: #236EE8;">
    <a class="ui-link" href="/cz/cs/65_chystane-akce.html" style="color: #236EE8;"> Chystané akce </a>
    <a class="small ui-link" href="/cz/cs/65_chystane-akce.html" style="color: #236EE8; float:right;"> >> </a>
    </h2>
  </div>
  <div class="ui-body" style="background-color: #F6F6FD;"></div>
  <div class="ui-body" style="background-color: #FCFCFC;"></div>
  <div class="ui-body" style="background-color: #F6F6FD;"></div>
</div>
</body>
</html>
 
(function() {
  
  $('.pagination').each(function(){
    var num_id = $(this).attr('id').match(/\d+/);
    num_id = parseInt(num_id[0],10);
        if($('.ui-body h2 a').attr('href').indexOf(num_id) != -1){
           $('.ui-body h2 a').closest('div').append($(this));
        }    
  });
  
}());
Output 300px

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

Dismiss x
public
Bin info
Freytagpro
0viewers