martes, 21 de abril de 2015

propiedad lenght y metodo size

<html>
     <head>
         <title>Prueba Size</title>
         <script type = "text/javascript" src = "jquery.js"> </script>
         <script type = "text/javascript">
            $(document).ready(function(){
               console.log('Número de links en el documento: (' + $('a').size() +').');
            });
         </script>
     </head>
    <body>
    <a href="http://www.google.com" title="Google">Google1</a><br>
    <a href="http://www.google.com" title="Google">Google2</a><br>
    <a href="http://www.google.com" title="Google">Google3</a><br>
    </body>
 </html>

<html>
     <head>
         <title>Prueba Length</title>
         <script type = "text/javascript" src = "jquery.js"> </script>
         <script type = "text/javascript">
            $(document).ready(function(){
               console.log('Número de links en el documento: (' + $('a').length +').');
            });
         </script>
     </head>
    <body>
    <a href="http://www.google.com" title="Google">Google1</a><br>
    <a href="http://www.google.com" title="Google">Google2</a><br>
    <a href="http://www.google.com" title="Google">Google3</a><br>
    <a href="http://www.google.com" title="Google">Google4</a><br>
    </body>
 </html>




No hay comentarios:

Publicar un comentario