Sometimes we need to perform action on an element which is not present in the viewable area of the page. We need to scroll down to the page in order to reach that element.Selenium cannot perform scrolling action directly. This can be achieved with the help of Javascript Executor and Actions class in Selenium. DOM can work on all elements on the web page with the help of Javascript.Selenium can execute commands in Javascript with the help of the execute_script() method. For the Javascript solution, we have to pass true value to the method scrollIntoView() to identify the object below ... Read More
Following is the code to create an image zoom:Example Live Demo * {box-sizing: border-box;} .img{ display: inline-block; } .img-zoom-container { position: relative; } .img-zoom-zoomLens { position: absolute; border: 1px solid #d4d4d4; width: 50px; height: 50px; } .myresult{ display: inline-block; } .img-zoom-result { border: 1px solid #d4d4d4; } Image Zoom Example Hover over the image on ... Read More
The HTML DOM Textarea defaultValue property returns and modify the default value of a text area element in an HTML document.SyntaxFollowing is the syntax −1. Returning defaultValueobject.defaultValue2. Adding defaultValueobject.defaultValue = “text”Let us see an example of HTML DOM Textarea defaultValue Property:ExampleLive Demo body { color: #000; background: lightseagreen; height: 100vh; } .btn { background: #db133a; border: none; height: 2rem; border-radius: 2px; width: 40%; display: block; ... Read More
The HTML DOM Textarea disabled property returns and modify whether the text area element in an HTML document is disabled or not.SyntaxFollowing is the syntax −1. Returning disabledobject.disabled2. Adding disabledobject.disabled = true | falseLet us see an example of HTML DOM Textarea disabled Property:ExampleLive Demo body { color: #000; background: lightseagreen; height: 100vh; } .btn { background: #db133a; border: none; height: 2rem; border-radius: 2px; width: 40%; display: block; color: #fff; outline: none; cursor: pointer; } DOM Textarea disabled Property Demo Disable Textarea function set() { document.querySelector("textarea").disabled = true; } OutputClick on “Disable Textarea” button to disabled the textarea element.
The HTML DOM Textarea wrap property returns and modify the value of wrap attribute of a text area element in an HTML document.SyntaxFollowing is the syntax −1. Returning wrapobject.wrap2. Adding wrapobject.wrap = soft | hardLet us see an example of HTML DOM Textarea wrap Property:ExampleLive Demo body { color: #000; height: 100vh; } .btn { background: #db133a; border: none; height: 2rem; border-radius: 2px; width: 40%; display: block; color: ... Read More
The HTML DOM Textarea form property returns the cite of the form which enclose the text area.SyntaxFollowing is the syntax −object.formLet us see an example of HTML DOM Textarea form Property:ExampleLive Demo body { text-align: center; background-color: #363946; color: #fff; } form { margin: 2.5rem auto; } button { background-color: #db133a; border: none; cursor: pointer; padding: 8px 16px; color: #fff; border-radius: 5px; ... Read More
The HTML DOM Textarea required property returns and modify the value of the required attribute of a text area in an HTML document.SyntaxFollowing is the syntax −1. Returning requiredobject.required2. Modifying requiredobject.required = true | falseLet us see an example of HTML DOM Textarea required Property:ExampleLive Demo DOM Textarea required Property body { text-align: center; } .btn { display: block; margin: 1rem auto; background-color: #db133a; color: #fff; border: 1px solid #db133a; padding: 0.5rem; ... Read More
The HTML DOM Textarea maxLength property returns and modify the value of maxLength attribute of a text area element in an HTML document.SyntaxFollowing is the syntax −1. Returning maxLengthobject.maxLength2. Modifying maxLengthobject.maxLength = “number”Let us see an example of HTML DOM Textarea maxLength Property:ExampleLive Demo body { color: #000; height: 100vh; } .btn { background: #db133a; border: none; height: 2rem; border-radius: 2px; width: 40%; display: block; color: #fff; ... Read More
The HTML DOM Textarea select() Method selects the content of a text area in an HTML document.SyntaxFollowing is the syntax −object.select()Let us see an example of HTML DOM Textarea select() Method −ExampleLive Demo body { color: #000; height: 100vh; } .btn { background: #db133a; border: none; height: 2rem; border-radius: 2px; width: 40%; display: block; color: #fff; outline: none; cursor: pointer; } DOM Textarea select() Method Demo Hi! I'm a text area element with some dummy text. Select textarea content function set() { document.querySelector("textarea").select(); } OutputClick on “Select textarea content” button to select the content of the textarea element.
The HTML DOM Textarea Object represent the element of an HTML document.Create Textarea objectSyntaxFollowing is the syntax −document.createElement(“TEXTAREA”);Properties of Textarea objectPropertyExplanationautofocusIt returns and modify whether the text area should automatically get focused or not when the page loads.defaultValueIt returns and modify the default value of a text area element in an HTML document.colsIt returns and modify the value of cols attribute of a text area element in an HTML document.disabledIt returns and modify whether the text area element in an HTML document is disabled or notformIt returns the cite of the form which enclose the text area.maxLengthIt returns and ... Read More