<input type="text" id="txt" oninput="inputFunction()"/>
        input {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-50%);
            transition: 2s;
            border: 2px solid #be3d3d;
            border-radius: 20px;
            text-indent: 10px;
            font-family: Verdana;
            outline: none;
            padding: 5px;
        function inputFunction() {
            alert("you are changing the contents of the text")
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.