Of course, (almost) anything is possible.
$(function() { $('span').html($('input').val()); $('input').on('keyup', function() { $(this).next('span').html($(this).val()); }); });
input { border: 0; border-bottom: 5px solid red; } label { position: relative; } span { position: absolute; left: 31px; top: 19px; height: 5px; overflow: hidden; color: white; background: white; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <label> CLG <input type="text" value="0123" /> <span></span> </label>
The label functions as a wrapper element (positioned relatively). Thus, the range can be set as absolute, and its position relative to the mark. The span has a height, the same as the lower border and white.
When loading a page or changing the value of inputs. HTML also changes within the range. Laying border.
Note that the font size inside the input and range must be exactly the same.
In addition, the starting point of the range refers to the label, not the input (since there is no end tag at the input, you cannot apply it to this). Therefore, by changing the CLG text or its font, you will also need to change the starting point of the range.
Linkinted
source share