Code to call the divs:
<input style="float: right;" class="botao1" onclick="addRisco()" value="Adicionar Risco"/>
</td>
</tr>
</table>
</fieldset>
<div id="riscos">
</div>
<fieldset class="grupo">
<table width="100%" class="campo" cellspacing="10">
<tr>
<td>
<input style="float: right;" class="botao1" onclick="addRisco1()" value="Acção"/>
</td>
</tr>
</table>
<div id="riscos1">
</div>
With this function whenever I click the button it opens a div:
function addRisco(){
$("#riscos").append("<div>"+$("#riscoform").html()+"</div>");
}
function addRisco1(){
$("#riscos1").append("<div>"+$("#riscoform1").html()+"</div>");
}
But I want the function to only allow the div to open once.