How to add and immediately remove html element by jquery -


i have button , want create or append element when clicking , after 1 sec has removed automatically how can it

you can try

  $('#btnid').click(function(){  $( "#divid" ).append( "<p id="test">test</p>" );       settimeout(function(){       $('#test').remove();     }, 1000);     }) 

Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -