Q: add class to every data i fetch with ajax() jquery method im fetching with the ajax() method in jQuery data and i want every time i fetch data to put them in a different div.
excuse my bad english...
For i.e. i fetch data1,data2...data4 with the code :
     $.ajax({
   url:'fetch.php',
   type: 'POST',
   data: { temp : counter },
  success: function(data){
  **$('#rules2').append(data).addClass('rules3');**
  }



<div id="rules2" class="rules3">  //Here adds class rules3
   <p>data1<br></p>
   <p>data2<br/></p>
   <p>data2<br/></p>
   <p>data2<br/></p>
</div>

while i want class rules3 to be added to every data
meaning
 <div id="rules2">  
       <p class="rules3">data1<br></p>  //Here adds class rules3
       <p class="rules3">data2<br/></p>  //Here adds class rules3
       <p class="rules3">data2<br/></p>  //Here adds class rules3
       <p class="rules3">data2<br/></p>  //Here adds class rules3
    </div>


A: Append returns #rules2. You whould jQuery data first, add the class, and append the result to #rules2:
$('#rules2').append($(data).addClass('rules3'))


A: You can use appendTo instead: 
$(data).addClass('rules3').appendTo('#rule2');

