Use append() method to insert a third <li> element: "List item 3", at the end of the <ol> element - Javascript jQuery

Javascript examples for jQuery:List

Description

Use append() method to insert a third <li> element: "List item 3", at the end of the <ol> element

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("ol").append("<li>List item 3</li>");
});/*www  .j  ava2 s  . c om*/
</script>
</head>
<body>

<ol>
  <li>List item 1</li>
  <li>List item 2</li>
</ol>

</body>
</html>

Related Tutorials