Search code examples
htmlvbscripttagscopy-paste

Retrieve tags from an HTML page to import them into another HTML file


Subject solved! The answer is below.

Good morning, everyone! So that's it, I'm telling you my problem. I currently have to create a small script allowing me to retrieve the tags from an HTML file and drop them to another HTML file. I had a possible idea to do this in VBS but without much success for the moment..... I also thought about doing this with a split but also without much success...

If you have examples of scripts, I'm a taker! Thank you.


Solution

  • I solved my problem! I relied on the code that was provided to me and that was removed and I followed the jQuery doc;)

    Doc link: http://api.jquery.com/load/

    My code:

    <html>
    <head>
      <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
    </head>
    
    <body>
      <script>
        $(function() {
        $("#PremierTest").load("file.html #test1");
        $("#DeuxiemeTest").load("file.html #test2");
        $("#TroisiemeTest").load("file.html #peutetre");
        });
      </script>
    
    
    <div id="PremierTest">
    
    </div>
    
    
    <div id="DeuxiemeTest">
    
    </div>
    
    <div id="TroisiemeTest">
    
    </div>
    
    
    </body>
    
    </html>
    

    Thank you to all of you :)