Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
Difference between append() and html() in jQuery      S.No       jQuery.append()                  jQuery.html()      1    ...
Prochain SlideShare
Chargement dans…5
×

Jquery.append() vs jquery.html()

6 512 vues

Publié le

Jquery.append() vs jquery.html()

Publié dans : Technologie
  • Identifiez-vous pour voir les commentaires

  • Soyez le premier à aimer ceci

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/

×