Found 448 Articles for Programming Scripts

How to get the innerHTML of a cell with JavaScript DOM?

Shubham Vora
Updated on 12-Oct-2022 09:01:26

6K+ Views

In this tutorial, we will learn how to get the innerHTML of a cell with JavaScript DOM. Use the innerHTML property in JavaScript to get the innerHTML of a cell. We can manipulate the DOM (Document Object Model) easily using document.getElementById(). It is a method that returns the element object that represents the id of the element whose id is mentioned in the method’s parameter. Since every tag’s id is unique, we can easily access the element by its id. Then the innerHTML property will help to access the text or content of that tag Using Table cells Collection To ... Read More

How to write a script to access document properties using IE4 DOM method?

Smita Kapse
Updated on 23-Jun-2020 07:27:28

71 Views

This IE4 document object model (DOM) introduced in Version 4 of Microsoft's Internet Explorer browser. IE 5 and later versions include support for most basic W3C DOM features.ExampleTo access document properties using IE4 DOM method, try to run the following code −           Document Title                                     This is main title       Click the following to see the result:                                                                

How to get the list of document properties which can be accessed using W3C DOM?

Ramu Prasad
Updated on 23-Jun-2020 07:06:10

137 Views

The following are the document properties which can be accessed using W3C DOM −Sr.NoProperty & Description1BodyA reference to the Element object that represents the tag of this document.Ex − document.body2DefaultViewIts Read-only property and represents the window in which the document is displayed.Ex − document.defaultView3DocumentElementA read-only reference to the tag of the document.Ex − document.documentElement8/31/20084ImplementationIt is a read-only property and represents the DOMImplementation object that represents the implementation that created this document.Ex − document.implementation

How to access document properties using W3C DOM method?

Sravani S
Updated on 23-Jun-2020 07:06:52

68 Views

This IE4 document object model (DOM) introduced in Version 4 of Microsoft's Internet Explorer browser. IE 5 and later versions include support for most basic W3C DOM features.ExampleTo access document properties using W3C DOM method, you can try to run the following code −           Document Title                                     This is main title       Click the following to see the result:                                                          

What is the role of special characters in JavaScript Regular Expressions?

V Jyothi
Updated on 23-Jun-2020 07:21:43

201 Views

The frequency or position of bracketed character sequences and single characters can be denoted by a special character. Each special character has a specific connotation. The +, *, ?, and $ flags all follow a character sequence.Sr.NoExpression & Description1p+It matches any string containing one or more p's.2p*It matches any string containing zero or more p's.3p?It matches any string containing at most one p.4p{N}It matches any string containing a sequence of N p's5p{2, 3}It matches any string containing a sequence of two or three p's.6p{2, }It matches any string containing a sequence of at least two p's.7p$It matches any string with p ... Read More

What are the document properties which can be accessed using Legacy DOM?

Nishtha Thakur
Updated on 23-Jun-2020 07:22:35

85 Views

The following are the document properties which can be accessed using Legacy DOM −Sr.NoProperty & Description1alinkColorDeprecated − A string that specifies the color of activated links.Ex − document.alinkColor2anchors[ ]An array of Anchor objects, one for each anchor that appears in the documentEx − document.anchors[0], document.anchors[1] and so on3applets[ ]An array of Applet objects, one for each applet that appears in the documentEx − document.applets[0], document.applets[1] and so on4bgColorDeprecated − A string that specifies the background color of the document.Ex − document.bgColor5cookieA string-valued property with special behavior that allows the cookies associated with this document to be queried and set.Ex − ... Read More

What are the document methods supported by Legacy DOM?

Priya Pallavi
Updated on 23-Jun-2020 07:23:30

56 Views

The following is the list of document methods supported by Legacy DOM −Sr.NoProperty & Description1clear( )Deprecated − Erases the contents of the document and returns nothing.Ex − document.clear( )2close( )Closes a document stream opened with the open( ) method and returns nothing.Ex − document.close( )3open( )Deletes existing document content and opens a stream to which new document contents may be written. Returns nothing.Ex − document.open( )4write( value, ...)Inserts the specified string or strings into the document currently being parsed or appends to document opened with open( ). Returns nothing.Ex − document.write( value, ...)5writeln( value, ...)Identical to write( ), except that ... Read More

How objects are organized in a web document? How is it arranged in a hierarchy?

Anvi Jain
Updated on 23-Jun-2020 07:24:03

169 Views

The Objects are organized in a hierarchy. This hierarchical structure applies to the organization of objects in a Web document.Window object − Top of the hierarchy. It is the utmost element of the object hierarchy.Document object − Each HTML document that gets loaded into a window becomes a document object. The document contains the contents of the page.Form object − Everything enclosed in the ... tags sets the form object.Form control elements − The form object contains all the elements defined for that object such as text fields, buttons, radio buttons, and checkboxes.The following is a simple hierarchy of a ... Read More

How can I access document properties using Legacy DOM method in JavaScript?

Srinivas Gorla
Updated on 23-Jun-2020 07:24:34

91 Views

To access document properties using Legacy DOM method in JavaScript, you can try to run the following code −Example           Document Title                                     This is main title       Click the following to see the result:                                                        

How can I write a script to use either W3C DOM or IE 4 DOM depending on their availability?

Abhinanda Shri
Updated on 23-Jun-2020 07:25:37

66 Views

If you want to write a script with the flexibility to use either W3C DOM or IE 4 DOM depending on their availability, then you can use a capability-testing approach that first checks for the existence of a method or property to determine whether the browser has the capability you desire.The following is the code snippet showing the same −if (document.getElementById) {    // If the W3C method exists, use it } else if (document.all) {    // If the all[] array exists, use it } else {    // Otherwise use the legacy DOM }

Advertisements