Prev Demo
jQuery
>
.Each() - Iterate Through Each Element
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> </head> <body> <p style="background-color:red;">Qnet is the parent Company!</p> <hr /> <div> <ol> <li>We are one</li> <li>Ocean</li> <li>Season</li> </ol> </div> These are child companies. <script> $('p').each(function (index) { alert(index + ': ' + $(this).text()); }); </script> </body> </html> >
Note: We DO NOT save your trial code in our database.
Output