jquery does not display content -


i simple bit of test code loop through , display content array. when run in browser, doesn't display or run errors.

<html>     <head>     <title>jquery each test</title>         <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>          <script type="text/javascript">             var arr = ["one", "two", "three", "four", "five"];             var task = "";             $(document).ready(               $.each(arr, function(index, value) {                 task += value + "<br>";                 $('div.content').html(task);               }));         </script>     </head>     <body>         <div class="content"></div>     </body> </html> 

change ready function code following line

 $(document).ready(function(){           $.each(arr, function(index, value) {             task += value + "<br>";             $('div.content').html(task);           })}); 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -