Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Ricavare l'ID del primo figlio firstChild

    Salve ragazzi....

    è possibile ricavare l'ID dato al firstChild del nodo di riferimento?

    in sostanza c'è una voce come "nodeValue" , "length" , "nodeName" ?

    Sono ore che cerco in giro per il web... non sò come fare

    Ciau^^

  2. #2

    ........

    Ciao.
    Esempio tirato via ma guarda
    se ti illumina
    Codice PHP:
    <html>
    <
    head><title>Using the DOM</title></head><body>



    <
    em id="pippo">oooo[/i]
    </
    p>
    <
    script type="text/javascript">
    //var p = document.getElementsByTagName("p")[0].childNodes[0];
    var document.getElementsByTagName("p")[0].firstChild;
    var 
    myId p.getAttribute("id");
    alert(myId);
    </script>
    </body></html> 

    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.