Is there any way to include a tag in a javascript file? [duplicate]

تبليغ
سؤال

يرجى شرح بإيجاز لمإذا تشعر أنك ينبغي الإبلاغ عن هذا السؤال.

تبليغ
‎إلغاء

I’m currently working on a challenge where I create an entire website in a single javascript file. I do this by using document.head.innerHTML and document.body.innerHTML to change the HTML of a page. Most of the javascript is contained in the actual javascript file, but I want to use a <script> tag inside the document’s head. The problem is, it doesn’t seem to work.

Example:

document.head.innerHTML = “<script src=”jquery-3.6.0.min.js”></script>”
does not work.

‫أضف إجابة

تصفح
تصفح

مجهول يجيب