How to use the Bootstrap to organize a call to the modal window when you click on the table row? In this case, the modal window will contain information that is shown in the corresponding row of the table. As far as I understand, you need to determine the id of the string.

Closed due to the fact that the issue is too general for the participants of Rostyslav Kuzmovych , LFC , vmchar , Sergey Nudnov , 0xdb May 22 at 20:47 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    Regardless, it's a tr or a div ... you can somehow get it through a class, like this:

    const bubu = document.getElementsByClassName('bubu'); const modal = document.getElementById('modal'); for(let i = 0; i < bubu.length; i++){ bubu[i].addEventListener('click', function(){ modal.innerText = this.innerText; modal.style.display = 'block'; }); } modal.addEventListener('click', function(){ this.style.display = 'none'; }); 
     #modal { display: none; width: 100vw; height: 100vw; position: fixed; z-index: 100500; background-color: rgba(0,0,0,0.5); text-align: center; } td { padding: 5px 20px; border: 1px solid red; } 
     <div id="modal">000</div> <table> <tr class="bubu"> <td>111</td> </tr> <tr class="bubu"> <td>222</td> </tr> </table> 

    The code will change, depending - exactly how to fill the content)