0
I have a website with 2 files (index.php and modals.php).
No index.php use include("modals.php");
and in modals.php I have several modals that are generated dynamically, according to the information in DB.
In modals.php I have 2 buttons (one created using the tag <button>Abre</button>
and other using the tag <input type"button" value="Abre" />
.
My goal is to use the tag <button></button>
to give Rigger at the event, because I’m using Bootstrap 3 and I want the button to have no text but a glyphicon.
In index.php I have:
<script type="text/javascript">
$( document ).ready(function() {
$(".botaoDoModal").click(function () {
alert("Funciona!");
});
});
</script>
but this script only works when I add class="botaoDoModal"
tag <input>
, the same does not happen with the tag <button></button>
.
I don’t know why, or if I was wrong and somewhere...
This question seems to be out of date because it is too localized and it is not possible to reproduce the problem.
– Sergio
Put the final result (all the code) so we can analyze it better
– rafaels88