DEV Community

Cover image for Run HTML, JS, CSS with JS
Mafee7
Mafee7

Posted on

3 3

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

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay