O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.
Difference between append() and html() in jQuery      S.No       jQuery.append()                  jQuery.html()      1    ...
Próximos SlideShares
Carregando em…5
×

Jquery.append() vs jquery.html()

Jquery.append() vs jquery.html()

  • Entre para ver os comentários

  • Seja a primeira pessoa a gostar disto

Jquery.append() vs jquery.html()

  1. 1. Difference between append() and html() in jQuery S.No jQuery.append() jQuery.html() 1 .append() add some value with .html() do the same as like the existing one. .append() but it removes the old value.Here is an example given to understand the practical difference between .append() and.html(),<ul id="test"><li>test</li></ul>Now if .append() is used to add one <li>,as given below<script type="text/javascript>" jQuery("#test").append("<li>test1</li>"); </script>The output of this jQuery will be <ul id="test"> <li>test</li> <li>test1</li> </ul>Now if .html() is used to add one <li>,as provided below<script type="text/javascript>" jQuery("#test").html("<li>test1</li>"); </script>The output of this Script will be <ul id="test"> <li>test1</li> </ul>Here in this example .append() add one extra <li>, whether .html() removes the old onewith new one. This is the main difference between .append() and .html() in JqueryReference:http://chaitanyalella.blogspot.in/2012/03/difference-between-append-and-html-in.htmlAnd, further updates on difference between questions and answers, please visit myblog @ http://onlydifferencefaqs.blogspot.in/

×