jquery not working after div reload

Hi my code was working perfectly suddenly it's stopped working. I have search using ajax, after search "div.results" is reload the Jquery is reloaded too. If I click on the "red heart" div should appear it's working normal but when I search and click, nothing working. http://gbctravel.com/hachem/pub/public/, from "Inspect element" I can see that when I click the div flashes but nothing happen !! any Idea?!!
Ajax :
function getArticless(url){
    var sq = $('#query').val();
    var price = $('#query').val();

             url: url + '?query=' + sq,
             type: "get",
            datatype: "html",  
            $('#sort').html('<h3>Hôtels populaires, priorité : </h3><span class="adress" style="    padding-top: 15px;">Price descending.</span><ul class="top-right-nav"><li><a  style="    padding-top: 15px;" href="/min" id="desc">Trier Par Price uniquement</a></li></ul>');


function hidethis(id){


<article class="one-third">
   <div id="listbutton" onclick="hidethis(0)" class="bookmark"></div>
   <div id="listdiv_0" style="display:none" class="bookmarklist">
      <div style="padding: 12px 8px;"> <span class="" style="float:left; font-size: 16px;">My hotel Lists</span><span class="cancelbookmark" onclick="hidethis(0)"></span></div>
      <div class="createlist"><a onclick="showthis(0)" class="createlist_0 ">Create new hotel list</a></div>
      <div id="createlistdiv_0" class="createlistdiv" style="display:none;">
         <input type="text" class="inputcreatelist_0" style="width: 60%; float: left; height: 30px;">
            <span class="validaddlist validaddlist_0" onclick="sendthis(&quot;0,15013&quot;)"></span>
            <span class="cancelbookmark morething" onclick="showthis(0)"></span>
Hayat IHYAAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
Firstly your listbutton id is not unique - you need to fix that - this code is not valid
$('.bookmarklist, #listbutton').clickOff(function() {
          $('.bookmarklist').css({ 'display': "none" });   

Open in new window

Secondly - when you load your html dynamically this will wipe out all statically linked events.

In your clickoff function I see what you are trying to do but it is not going to work.
you should rather do this

$('body').on('click','.clickoff-link', function(

Open in new window

Give your hearts the clickoff-link class (change to another name if this does not suit you) and use that in the click handler. That way you will have the click dynamically bound to any new content that arrives with a clickoff-link class.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Hayat IHYAAuthor Commented:
When I search for hotel name for example, my Ajax will generate html code like this one
 <article class="one-third">
     <div id="listbutton" onclick="hidethis(ID)" class="bookmark"></div>
     <div id="listdiv_ID" style="display:none" class="bookmarklist">

Open in new window

Where the ID is variable from 0 to 10 for example !
for each hotel result it's has his own "red heart" & bookmarklist So to make div.bookmarklist appear, it need just click on the heart associate with it, to make hidethis(id) function run.
The example of html that I give at first it was the html code for the first hotel result, where the ID is equal to 0.
The code was working perfectly and suddenly it stops.
I know  that just div is reload after search not entire code, but my jquery code is inside the reloaded div.
Julian HansenCommented:
Id's must be unique - end of story. If you are building a solution that is based on attaching events to duplicate id's it is not going to work.

You are also statically binding your event handler as describe above - when you are loading your new content those bindings are being wiped out.

Maybe in an earlier version you were returning javascript with your html to re-do the binding and now you are not - I am just calling it as I see it.
Hayat IHYAAuthor Commented:
Each "heart" has unique ID who has unique div.bookmarklist to display, it's not the problem, after some test I found after I do the search div.bookmarklist is listened, simple alert() can confirm. I can executed different code but not ".toggle()"
for example:
function hidethis(id){ 

Open in new window

Each "heart" shows in alert the html code of '#listdiv_'+id for calling ID but with .toggle() not working
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.