Solution 1 :

Yes you could with Jquery Attr Selector


Solution 2 :

Yes you can do like


You can learn more about selectors at

I suggest you get the data via an ID $(#alarm) that is unique in the document.

Problem :

I have the following function for calling the modal”

function openModal(x) {
(function ($) {



and for the modal:

 <div id="alarm" class="modal fade modal-alert" data-value="'.$element['eventId'].'">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                         <div class="modal-body" id="boxPopUpPushCommand" style="text-align:left !important">
                            Body texts here 

                    </div><!-- /.modal-content -->
                </div><!-- /.modal-dialog -->
            </div><!-- /.modal --> 

Trying to open a specific modal using the data-value and not the id?