How to change the shape of a textarea using JavaScript ? Last Updated : 19 Jan, 2023 Comments Improve Suggest changes Like Article Like Report In General, Textarea will be in the form of rectangular or square shapes, but here we will deal with Unusual shapes of textarea which means this textarea will not be regular shapes but editable. Method 1: In the first method, let's see the irregular editable textarea created using CSS-shapes and content editable attribute when it is true. Example: html <style> div { top: 124px; margin-left: 150px; outline: none; } #parallelogram { color: white; font-weight: bold; width: 250px; height: 200px; transform: skew(20deg); background: #f00; overflow: hidden; } #eq-triangle { width: 300px; height: 0; border-bottom: 104px solid blue; /* 104 = 120 * 0.866 */ border-left: 60px solid transparent; border-right: 60px solid transparent; } .circle { display: table-cell; padding: 40px; width: 200px; height: 200px; border-radius: 50%; font-size: 30px; color: #fff; line-height: 50px; text-align: center; background: #40a977; word-break: break-all; justify-content: center; overflow: hidden; } </style> <h1>Parallelogram Shaped TextArea</h1> <label> <h3>Enter Comments:</h3> </label> <div id="parallelogram" contenteditable="true"> Enter the something... </div> <h1>eq-triangle shaped TextArea</h1> <label> <h3>Enter Comments:</h3> </label> <div id="eq-triangle" contenteditable="true"> Enter the something... </div> <h1>Circle shaped TextArea</h1> <label> <h3>Enter Comments:</h3> </label> <div class="circle" contenteditable="true"> Enter the something... </div> Output: Method 2: Change the shape of textarea using JavaScript. First, get the element using id and then change the shape using style.transform = "skew(40deg)";. Example: Let's use javascript to create unusual textarea. html <style> textarea { color: brown; font-weight: bold; width: 250px; height: 200px; background: #ff7; overflow: hidden; } </style> <h1 style="color:green"> GeeksforGeeks </h1> <center> <textarea id="myP"> Unusual shape of a textarea </textarea> </center> <br> <button onclick="myFunction()"> Try it </button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById( "myP").style.transform = "skew(-30deg)"; document.getElementById("demo").innerHTML = x; } </script> Output: How to change the shape of a textarea using JavaScript? Comment More infoAdvertise with us Next Article How to change the shape of a textarea using JavaScript ? V VigneshKannan3 Follow Improve Article Tags : JavaScript Web Technologies HTML CSS JavaScript-Questions +1 More Similar Reads JavaScript - How to Change the Content of a <Textarea> ? Here are the various methods to change the content of a textarea using JavaScript.1. Using value PropertyThe value property is the most common method to change or retrieve the content of a <textarea>.HTML<textarea id="myTextarea">Initial content</textarea> <button onclick="chang 2 min read How to Add Text Formatting to a Textarea using JavaScript? To add text formatting (such as bold, italic, or inserting special characters) to a <textarea> using JavaScript, you can manipulate the selected text or insert formatted text at the cursor position. This can be done by directly modifying the value of the <textarea> based on user interact 3 min read How to create auto-resize textarea using JavaScript/jQuery ? Creating an auto-resize textarea using JavaScript or jQuery means dynamically adjusting the height of the textarea to fit its content as the user types. This enhances user experience by preventing the need for scrolling within the textarea, ensuring all content is visible.Table of ContentUsing JavaS 3 min read How to make a word count in textarea using JavaScript ? Counting words may be useful in scenarios where the user is recommended to enter a certain number of words and the word counter can keep track of the same. Below are approaches to make a word count in textarea using JavaScript:Table of Content Calculating the number of spaces present in the textSepa 4 min read How to Disable Textarea using JavaScript? This article will show you how to disable the textarea using JavaScript. Disabling a textarea using JavaScript can be done by setting the disabled property of the textarea element to true. This prevents the user from editing the content of the textarea. There are some reasons to use disabled textare 2 min read JavaScript Change the Text of a Span Element Updating the text of HTML elements, such as a <span> in JavaScript allows developers to dynamically alter webpage content. This technique is used for creating interactive web features like displaying user feedback, updating real-time data, or modifying elements based on user actions. Here, we' 3 min read How to Change the Placeholder Text using jQuery? We can change the placeholder Text of an input element using the attr() attribute and placeholder property of jQuery. We will create a button and on clicking the button the text of the placeholder will be changed dynamically.Below are the approaches to change the placeholder text using jQuery:Table 2 min read How to get the value of a textarea in jQuery ? To get the value of a textarea in jQuery, you can use the val() method. This method is commonly used to retrieve the current value of form elements like textarea, input, and select. It works by either retrieving or setting the value of the selected element. If no input is provided, the method return 2 min read How to create a Textarea Input Box using jQuery Mobile ? jQuery Mobile is a web based technology used to make responsive content that can be accessed on all smartphones, tablets and desktops. In this article, we will be a Textarea Input box using jQuery Mobile. Approach: Add jQuery Mobile scripts needed for your project. <link rel=âstylesheetâ href=âht 1 min read Get the Value of Text Input Field using JavaScript Getting the value of a text input field using JavaScript refers to accessing the current content entered by a user in an input element, such as <input> or <textarea>, by utilizing the value property. This allows for dynamic interaction and data manipulation in web forms.Syntax inputField 2 min read Like