<input type="search" id="sBox" placeholder="search..."/>
        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;
        }
        document.getElementById("sBox").addEventListener("search",shFunction);
       

        function shFunction() {
            alert("onsearch feature worked.")
        }
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.