You can do this by using append function in jQuery as below snippet
$('#main_conatiner').append( $('<p><img src="loader.gif"></p>').hide().fadeIn(2000) );
Or you can use appendTo function as below
var html ='<p><img src="loader.gif"></p>'; $(html).hide().appendTo("#main_conatiner").fadeIn(2000);
Did this post help you?
Tutsplanet brings in-depth and easy tutorials to understand even for beginners. This takes a considerable amount of work. If this post helps you, please consider supporting us as a token of appreciation:
- Just want to thank us? Buy us a Coffee
- May be another day? Shop on Amazon using our links.
Your prices won't change but we get a small commission.
Leave a Reply