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
Post a Comment