TIL how to make my own codepen like
To make your own codepen like, you just need to follow these instructions:
- Open a website page like example.com
- Open the developper tools (right click and inspect page)
- On the inspect tab, richt click on the <body> tag and select "Modify as HTML" or similar
- Replace the code with
<body oninput="i.srcdoc=h.value+'<style>'+c.value+'</style><script>'+j.value+'</script>'"><style>textarea,iframe{width:100%;height:50%}body{margin:0}textarea{width:33.33%;font-size:18}</style><textarea placeholder=HTML id=h></textarea><textarea placeholder=CSS id=c></textarea><textarea placeholder=JS id=j></textarea><iframe id=i></iframe></body>
And.. tada.. you should see womething like this:
You can add your own html/CSS/JS code to test your snippets
This code can be tried on any website. But it will not work if a Content Security Policy is activated. This snippet is very basic but does the job :)
Enjoy!