=======================================================================
You
-----------------------------------------------------------------------
If your insert HTML code that contains script tags using insertAdjacentHTML, will those script tags be executed?
-----------------------------------------------------------------------
Copilot
-----------------------------------------------------------------------
When you use insertAdjacentHTML to insert HTML code containing <script> tags into the DOM, the <script> tags will not be executed. This behavior is similar to using innerHTML, where <script> elements inserted do not execute when they are inserted12.

If you want to execute scripts dynamically, you would need to create a new <script> element and append it to the DOM. Here’s an example of how you can do this:
=======================================================================

=======================================================================
Q. Suppose you use createContextualFragment to create HTML fragments that contain script tags. Will those script tags be executed when you insert the fragments into DOM?
-----------------------------------------------------------------------
ChatGPT
-----------------------------------------------------------------------
A. When you use createContextualFragment to create HTML fragments that contain script tags, the script tags will not be executed when you insert the fragments into the DOM. This behavior is due to how the DOM parsing and execution engine handles dynamically created HTML content.
-----------------------------------------------------------------------
これは、これは間違っている可能性が高い。createContextualFragmentを使って
<script>を含むHTMLを作りInsertしてみたら、<script>は実行された。
さらに、DOMContentLoadedのイベントからcreateContextualFragmentを使って
<script>を含むHTMLを作りInsertしてみたら、<script>は実行された。
=======================================================================

=======================================================================
DocumentFragmentは<head> and <body>を持つことはできない。
DocumentFragmentは<head> and <body>より小さいHTMLの塊を持つための
ものである。
-----------------------------------------------------------------------
A DocumentFragment will still strip the <head> and <body> tags, 
=======================================================================
