Add more height to an Input element using Javascript

Add more height to an Input element using Javascript:

<input type="text" id="charAndSymbolsInput" style="height: 60px; font-size: 20px; line-height: 60px;">

<button type="button" onclick="AddHeight();return false;">Click Me to Add more height!</button>

<script>
function AddHeight() {
var x = document.getElementById("charAndSymbolsInput");

var oldSize = x.style.height;
var newSize = Number(oldSize.replace(/[^0-9]/g, ""));

newSize = newSize + 16;
x.style.height = newSize + "px";
x.style.lineHeight = newSize + "px";
}
</script>

Leave a Reply

Your email address will not be published. Required fields are marked *