Javascript Articles

Page 445 of 534

What is availHeight property in JavaScript?

karthikeya Boyini
karthikeya Boyini
Updated on 23-Jun-2020 117 Views

Use the screen.availHeight property to return the width of the user’s screen. The result will be in pixels and Taskbar feature won’t be included.ExampleYou can try to run the following code to learn how to work with the screen.availHeight property in JavaScript −Live Demo                    document.write("Height of the screen: "+screen.availHeight);          

Read More

What is the role of pageXOffset property in JavaScript?

Samual Sam
Samual Sam
Updated on 23-Jun-2020 288 Views

If you want to get the pixels the document scrolled to from the upper left corner of the window, then use the pageXoffset and pageYoffset property. Use pageXoffset for horizontal pixels.ExampleYou can try to run the following code to learn how to work with pageXOffset property in JavaScript −Live Demo                    div {             background-color: green;             height: 1500px;             width: 1500px;          }                              function scrollFunc() {             window.scrollBy(200, 200);             alert("Horizonal: " + window.pageXOffset);          }             Scroll                      

Read More

With JavaScript RegExp search a hexadecimal number character.

Smita Kapse
Smita Kapse
Updated on 23-Jun-2020 446 Views

To find a hexadecimal number character with JavaScript Regular Expression, use the following. Add the hexadecimal number here −\xddExampleYou can try to run the following code to find hexadecimal number character. It searches for hexadecimal number 53 i.e. S −           JavaScript Regular Expression                        var myStr = "Secure and Responsive!";          var reg = /\x53/g;          var match = myStr.match(reg);                    document.write(match);          

Read More

With JavaScript Regular Expression find a non-whitespace character.\\n\\n

Daniol Thomas
Daniol Thomas
Updated on 23-Jun-2020 496 Views

To find a non-whitespace character, use the following −\SExampleYou can try to run the following code to find non-whitespace character −        JavaScript Regular Expression                        var myStr = "100% Responsive!";          var reg = /\S/g;          var match = myStr.match(reg);                    document.write(match);          

Read More

For Hosts Locale how to convert a string to lowercase letters in JavaScript?

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 23-Jun-2020 187 Views

To convert a string to lowercase letters in JavaScript, use the toLocaleLowerCase() method.ExampleYou can try to run the following code to learn how to work with toLocaleLowerCase() method in JavaScript −Live Demo                    var a = "WELCOME!";          document.write(a.toLocaleLowerCase());          

Read More

With JavaScript RegExp search a carriage return character.

Ayyan
Ayyan
Updated on 23-Jun-2020 730 Views

To find carriage return character with JavaScript Regular Expression, use the following −\rExampleYou can try to run the following code to find a carriage return character. It returns the position where the carriage return (\r) character is found −           JavaScript Regular Expression                        var myStr = "100% \r Responsive!";          var reg = /\r/;          var match = myStr.search(reg);                    document.write(match);          

Read More

What is the usage of in operator in JavaScript?

Arushi
Arushi
Updated on 23-Jun-2020 181 Views

The operator is used in JavaScript to check whether a property is in an object or not.ExampleYou can try to run the following code to learn how to use in operator in JavaScript −Live Demo                    var emp = {name:"Amit", subject:"Java"};          document.write("name" in emp);          document.write("");          document.write("subject" in emp);          document.write("");          document.write("MAX_VALUE" in Number);          document.write("");          document.write("MIN" in Number);          

Read More

With JavaScript RegExp find a character except newline?

Anvi Jain
Anvi Jain
Updated on 23-Jun-2020 280 Views

To find a character except for a newline, use the Metacharacter. (period). You can try to run the following code to find a character −Example           JavaScript Regular Expression                        var myStr = "We provide websites! We provide content!";          var reg = /p.o/g;          var match = myStr.match(reg);                    document.write(match);          

Read More

With JavaScript DOM delete rows in a table?

Sharon Christine
Sharon Christine
Updated on 23-Jun-2020 6K+ Views

To delete rows in a table in JavaScript, use the DOM deleteRow() method.ExampleYou can try to run the following code to learn how to delete rows in a table. The code deletes rows one at a time −Live Demo                 function captionFunc(x) {          document.getElementById(x).createCaption().innerHTML = "Demo Caption";       }                                           One             Two                                 Three             Four                                 Five             Six                                                                

Read More

How to create a table caption with JavaScript DOM?

Jai Janardhan
Jai Janardhan
Updated on 23-Jun-2020 649 Views

To create a table caption, use the DOM createCaption() method.ExampleYou can try to run the following code to learn how to create table caption −Live Demo                    function captionFunc(x) {             document.getElementById(x).createCaption().innerHTML = "Demo Caption";          }                                           One             Two                                 Three             Four                                 Five             Six                                          

Read More
Showing 4441–4450 of 5,338 articles
« Prev 1 443 444 445 446 447 534 Next »
Advertisements