code-input
vs the textarea
in JavaScript
Contributors: 2025 Oliver Geer
Once registered, code-input
elements support most of the JavaScript properties and events used with a textarea
element, because they are built around them. Try swapping out your textarea
element in your JavaScript application for a code-input
! If it doesn’t work, submit a bug report.
If you want to replace a textarea
with a code-input
in an application that doesn’t need JavaScript, look here. We support HTML5 forms, and progressive enhancement so JavaScript isn’t needed!