vendredi 17 juillet 2015

Using input from checkbox to change color of button

I have 5 rows of 30 buttons. A modal pops up when a button is clicked. Inside the modal is a checkbox. When the checkbox is checked, I need that button to change to a red color. I've tried a few things, but they haven't worked. Any ideas?

HTML:

            <button type="button" class="btn btn-primary btn-xs gridbtn" data-toggle="modal" data-target="#myModal">number</button>

            <!-- Modal -->
            <div class="modal fade" id="myModal" role="dialog">
                <div class="modal-dialog">

                    <!-- Modal content-->
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal">&times;</button>
                            <h4 class="modal-title">Testing</h4>
                        </div>
                        <div class="modal-body">
                            <form role="form">
                                <div class="form-group">
                                    <label for="email">Email address:</label>
                                    <input type="email" class="form-control" id="email">
                                </div>
                                <div class="form-group">
                                    <label for="pwd">Password:</label>
                                    <input type="password" class="form-control" id="pwd">
                                </div>
                                <div class="checkbox">
                                    <label><input type="checkbox"> Remember me</label>

                                </div>
                                <button type="submit" class="btn btn-default">Submit</button>
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                        </div>
                    </div>
                </div>
            </div>




Aucun commentaire:

Enregistrer un commentaire