<body>
<form action="" method="post">
<input type=text name=varcols id=varcols value=50>
<input type=button value="+" id="pluscols"><input type=button value="-" id="minuscols">
<br>
<input type=text name=varrows id=varrows value=50>
<input type=button value="+" id="plusrows"><input type=button value="-" id="minusrows">
<br>
<input type=button value="изменить размер" id="setcr">
<br>
<textarea cols=20 rows=20 id="myTextarea"> </textarea>
</form>
<script>
document.getElementById("setcr").onclick = function(){
document.getElementById("myTextarea").cols = document.getElementById("varcols").value;
document.getElementById("myTextarea").rows = document.getElementById("varrows").value;
};
document.getElementById("pluscols").onclick = function(){
document.getElementById("varcols").value++;
};
document.getElementById("minuscols").onclick = function(){
document.getElementById("varcols").value--;
};
document.getElementById("plusrows").onclick = function(){
document.getElementById("varrows").value++;
};
document.getElementById("minusrows").onclick = function(){
document.getElementById("varrows").value--;
};
</script>
</body>
|