I want to replace the button submit identified by dvv with ""( just to remove the button). So I'm using this code, It works but I should click on the button 'test" twice to work. Any explanation?
<script>
$.fn.gotof = function() {
$(document).ready(function(){
$('#btt').click(function(){
$('#dvv').replaceWith("");
});
});
};
function dofunc() {
$.fn.gotof();
}
</script>
<button id="btt" onclick="dofunc()">
test
</button>
<div id="dvv">
<input type="submit" value="submit">
</div>