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

    removeChild non funziona

    buon Natale!

    ragazzi com'e' che questo codice tratto da un signor sito non mi funziona?

    <HEAD>
    <SCRIPT>
    function removeElement()
    {
    try
    {
    //The first child of the div is the bold element.
    var oChild=Div1.children(0);
    Div1.removeChild(oChild);
    }
    catch(x)
    {
    alert("You have already removed the bold element.
    Page will be refreshed when you click OK.")
    document.location.reload();
    }
    }
    </SCRIPT>
    </HEAD>
    <BODY>
    <DIV ID=Div1 onclick="removeElement()">
    Click anywhere in this sentence to remove this Bold word.
    </DIV>
    </BODY>

    grasias

    (l'ho provato con IE e Mozilla)
    si vivono molte vite e si muore una volta sola

  2. #2
    Utente di HTML.it L'avatar di badaze
    Registrato dal
    Jun 2002
    residenza
    Lyon
    Messaggi
    5,372
    Funziona benissimo forse i vapori di alcool....

    Prova mettere su una sola riga

    alert("You have already removed the bold element.
    Page will be refreshed when you click OK.")

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.