0
Well I’m new in jQuery and I’m having a problem, as I do to select the element itself and not what is inside it, follows code:
$('#add_phone').bind('click', function(){
var html = '';
html += $('[camp=phone]').find('input');
$('#add_phone_div').append(html);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.2.3/jquery.min.js"></script>
<div camp="phone">
<input type="text" name="phone[]" data-inputmask='"mask": "(99) 9 9999-9999"' data-mask>
</div>
<div id="add_phone_div"></div>
<hr/>
<button id="add_phone">ADD CONTATO EXTRA</button>
What I intend to do is take the input HTML copy it and paste it into the id="add_phone_div div"
Wow I didn’t know the clone() of jQuery, helped me a lot, thank you!
– Anorak
Jquery has several methods that save our code! Give nothing @Anorak!
– Victor Carnaval