I need when a person clicks a particular button, an element is created on the page.
I'll explain what I want to do with this.
I am creating a button, and when it is clicked, a
modal-box
appears (a kind of window that lowers on the screen), and within this modal, I want to put some social widgets, like facebook, twitter, Google+, etc. But I need these widgets to load only when the person clicks the "share" button.
What I need is this.
A link that when clicked loads the modal content.
My code
Button:
<a href="#compartilhar" data-toggle="modal">Compartilhar</a>
Modal:
<div id="compartilhar" class="modal" tabindex="-1" role="dialog" aria-labelledby="loginModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<span id="loginModalLabel">Compartilhe!</span>
</div>
<div class="modal-body">
<!-- AQUI IRÁ FICAR O CONTEÚDO CARREGADO /-->
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancelar</button>
</div>
</div>
Thank you in advance: D