Run HTML, JS, CSS with JS

mafee6

Mafee7

Posted on February 26, 2021

Run HTML, JS, CSS with JS

Q: How to run Run HTML, JS, CSS with JS?

Ans: BLOB!

Can Be Used As File eg: src="outputFileUrl"

Use Code:

var codeText = ``; // Some Code In HTML/JS/CSS

var outputFileUrl = URL.createObjectURL(new Blob([codeText], {

// Can Use Any File Type
type: "application/javascript" // - For JS, "text/html" For HTML, "text/css" for CSS

}));


Enter fullscreen mode Exit fullscreen mode

Possible Uses: **
1) **Code Editor

2) Editing JS After Page Loads.
3) Many More!

See My Example: CodePan

💖 💪 🙅 🚩
mafee6
Mafee7

Posted on February 26, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related