Change Document Title On Button Click With Javascript
<!DOCTYPE html>
<html>
<head>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<style>
body{
background: #eeeded;}
textarea{
width:100%;}
.auto-resize, #autoResize{
height:45px;
display: block;
overflow: hidden;
resize: none;
border-left:0px;
border-right:0px;
border-top:0px;
margin-bottom:50px;
width:100%;
padding:15px;
padding-bottom:0px}
textarea:focus{
outline:none}
.textarea-container{
width:50%;
position:relative;
left:100px;}
.textarea-container h3{
color:blue}
</style>
</head>
<body>
<div class="textarea-container">
<h3>Default Textarea</h3>
<textarea placeholder="Enter Text Here...">
</textarea>
<h3>Auto Resize Single Textarea</h3>
<h3>Auto Resize Multiple Textarea </h3>
<textarea class="auto-resize" placeholder="Enter Text Here...">
</textarea>
<textarea class="auto-resize" placeholder="Enter Text Here...">
</textarea>
<textarea class="auto-resize" placeholder="Enter Text Here...">
</textarea>
</div>
<script>
var multipleFields=document.querySelectorAll('.auto-resize');
for(var i=0; i<multipleFields.length; i++){
multipleFields[i].addEventListener('input',autoResizeHeight,0);
}
// auto resize multiple textarea
function autoResizeHeight(){
this.style.height="auto";
this.style.height= this.scrollHeight+"px";
this.style.borderColor="green";
}
</script>
</body>
</html>
Change Document Title On Button Click With Javascript
첫댓글 https://www.w3schools.com/css/tryit.asp?filename=trycss_default
https://www.google.com/search?client=avast-a-1&q=How+to+Auto+Resize+Textarea+using+HTML+CSS+%26+JavaScript&ie=UTF-8#ip=1
https://www.google.com/search?q=How+to+Auto+Resize+Textarea+using+HTML+CSS+%26+JavaScript&client=avast-a-1&sca_esv=585486504&tbm=isch&sxsrf=AM9HkKmyykB0OCNinva-u5qNP0LSAK-eIQ:1701043910647&source=lnms&sa=X&ved=2ahUKEwiehaqw8uKCAxVnha8BHejvCKkQ_AUoA3oECAQQBQ&biw=1904&bih=942&dpr=1
https://stackoverflow.com/questions/58073030/how-to-auto-resize-the-textarea-to-fit-the-content