1 month ago

How can I get the value inside the modal from when I click on the answer?

Posted 1 month ago by imrulhasan273

I am making something like that,

@foreach ($answers as $answer)
@if ($question->id == $answer->question_id)
<div >
   <div class="data-show" data-toggle="modal" data-target="#betting" id="select">
              <span id="ansID" class="" text-align="center" style="color:#F9CD51;">

ABove is my code when I click in the ans row. It will open the below modal

<div  class="modal fade betForm" id="betting" role="dialog" aria-hidden="true" style="display: none;">
    <div class="modal-dialog">
<span id="BettingSubTitleOption">
       {{ here should be the ans }}

Above is the modal. the problem How can I pass the ans value in the modals inside <span></span> tag.

As first code is inside loop. So the modal need to get the value dynamically may be.

Please sign in or create an account to participate in this conversation.