I'm doing tests on javascript
, so that, with clicar
in given botão
, one item adds up, another botão
another item adds, and so on but none of botões
works
* All of them follow the pattern below, changing only names of id's
$('#btn-1').click(function(){
if($('#imagem-chamada').css('display') != 'none'){
$('#imagem-chamada').addClass('hide');
$('#new-img').addClass('show');
}else{
$('#imagem-chamada').addClass('show');
$('#new-img').addClass('hide');
}
});
* I tried to use .show()
and .hide()
* I also tried to use .css('display', 'inline-block/none')
<div id="new-img">
<div class="file" id="image-holder"></div>
<label for="fileUpload">Alterar Imagem</label>
</div>
<div id="imagem-chamada" >
<img class="file" id="src-img">
<label id="btn-1" for="fileUpload">Alterar Imagem</label>
</div>