weardstuff weardstuff - 2 months ago 15
CSS Question

w3school try it editor

Does enyone know how to get or where to get or how to make or some tutorial, about the w3schools try it editor?

I need some editor like it so when typing, js/html/css to be accepted and to be shown like the try it or similar to it .

Answer

The "editor" you are referring to is nothing more but:

<form action="<?= $_SERVER["PHP_SELF"] ?>" method="POST">
<input type="submit">

<textarea name="code"><?= htmlentities($_POST["code"]) ?></textarea>

<div id="output">
  <?= $_POST["code"] ?>
</div>

And the PHP form sending could even be replaced by:

<button onclick='$("#output").html( $("textarea#code").value )'>
Comments