How to pass the id of the link in a modal window in bootstrap?

There is a link.
<a class="glyphicon glyphicon-time" title="Choose period" data-toggle="modal" data-target="#StaticModal" id="{{ item[0][0] }}" href="#"></a>


When clicked a modal window.
<!-- Modal -->
<div class="modal fade" id="StaticModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
 <div class="modal-dialog" role="document">
 <div class="modal-content">
 <div class="modal-header">
 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
 <h4 class="modal-title" id="myModalLabel">Upload statistics</h4>
</div>
 <div class="modal-body">
 <div class="container-fluid">
 <div class="row">
 <p>to Upload sensor data of humidity and temperature for the period:</p>
 <div class="col-xs-8 col-sm-6">
 <p><b>From</b> <input required type="date" name="stadby_date" class="form-control" min="2016-05-01" max="2019-05-01" title="date expectations"></p>
</div>
 <div class="col-xs-4 col-sm-6">
 <p><b>To</b> <input required type="date" name="stadby_date" class="form-control" min="2016-05-01" max="2019-05-01" title="date expectations"></p>
</div>
</div>
</div>
</div>
 <div class="modal-footer">
 <button type="button" class="btn btn-default" data-dismiss="modal">Back</button>
 <button type="button" id="myButton" data-loading-text="Wait..." class="btn btn-primary">
Save</button>
</div>
</div>
</div>
</div>


how to pass id in the modal window?
July 9th 19 at 13:08
1 answer
July 9th 19 at 13:10
Solution
not quite clear what it means "to pass to a modal window"
var id;
$('[data-target="#StaticModal"]').click(function(){ id = this.id; });

so you can get the id of the link that will open that window in a variable what to do next - you decide

Find more questions by tags AJAXBootstrapjQuery