call javascript function outside foreach loop
问题 I have a problem with my JavaScript function, when I put my script inside foreach loop like code I have below everything work fine, but I think it should be outside, so anyone can give me the advide to resolve this, I appreciate it @foreach($messages->reverse() as $message ) <ul class="id{{$message->id}}" data-id="{{$message->id}}"> <li class="message"> <div class="text {{ ($message->to!=Auth::user()->id)?'not_owner':'owner'}}"> {{$message->text}} </div><br> </li> <li class="message"> <div