I am working on making a website and I am having some trouble.
On one page there is a table of names that looks something like this:
<table class="table" id="table">
<thead>
<tr>
<th id="name">Teacher</th>
<th id="courses">Courses</th>
</tr>
</thead>
<tbody>
<tr>
<td><a data-toggle="modal" href="#myModal" id="1">Katherine Crowley</a></td>
<td>English</td>
</tr>
<tr>
<td><a data-toggle="modal" href="#myModal" id="2">Seraphine Hamilton</a></td>
<td>English</td>
</tr>
There are more entries, but that is a good example. When you click on the name in the table, "Katherine Crowley" in this example, a modal opens up, where I would like to have information on the person. Here is the code for the modal:
<div class="modal" id="myModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" href="#name"></h4>
</div><div class="container"></div>
<div class="modal-body">
Content
<br>
<br>
<br>
<p>more content</p>
<br>
<br>
<br>
</div>
<div class="modal-footer">
<a href="#" data-dismiss="modal" class="btn">Close</a>
<a href="#" class="btn btn-primary">Save changes</a>
</div>
</div>
</div>
The idea is that the title of the modal will be set to the name of the person, and then in the content area, the courses will be listed.
Does anyone know how I can do this??
I am fairly new to all of this, so as much detail as possible would be appreciated.
Thanks!
EDIT: Look in the comments below this. Dan commented a link to another question, where I found what I was looking for. If a mod could mark this question as a duplicate, that it would be appreciated.