Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What objects and arrays does JavaScript have?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the knowledge of "what objects and arrays does JavaScript have". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

B.1 anchor object

A HTML trace point created with a tag can be targeted by a link if the anchor point includes the HREF= property, it is also a linked object.

The anchor object is a property of the document object and has no property methods or event handlers of its own.

B.2 anchors array

The anchors array is a property of the document object and is a list of all anchor objects in the document. If anchor is also a link, it appears in both the anchors and links arrays.

Attribute

Number of anchors in the length document

B.3 array object

The array object is a new object introduced in Netscape Navlgator 3.0 beta 3, so it cannot be used in Netscape 2.0 as a built-in object rather than a property of other objects.

Attribute

The number of values in the length array

B.4 button object

It is an attribute of the form object and is created using tags.

Attribute

NAME= attributes in name HTML tags

VALUE= attributes in value HTML tags

Method

Click Simulation Mouse Click a Button

Event handler

Onclick

B.5 checkbox object

It is an attribute of the form object and is created using tags.

Attribute

Selection status of the checked check box

CHECKED= characteristics of defaultChecked tags

NAME= characteristics of name tags

VALUE= characteristics of value tags

Method

Click simulates mouse click button

Event handler

Onclick

B.6 Date object

It is a built-in object. Rather than the properties of other objects, it allows the user to perform various procedures for using dates and times.

Method

GetDate () looks at the Date object and returns the date

GetDay () returns what day of the week

GetHours () returns hours

GetMinutes () returns the number of minutes

GetMonth () returns the month value

GetSeconds () returns the number of seconds

GetTime () returns the full time

GetTimezoneoffset () returns the time zone deviation (the number of hours between the Greenwich mean time and the time zone setting of the computer running the script)

GetYear () returns the year

Parse () returns the number of milliseconds in the Date string since 00:00:00 on January 1, 1970 (the Date object stores the date and time since then in milliseconds), but note that the method does not currently run correctly

SetDate () changes the date of the Date object

SetHours () change number of hours

SetMinutes () changes minutes

SetMonth () changes the month

SetSeconds () changes the number of seconds

SetTime () changes the complete time

SetYear () changes the year

ToGMTString () converts the date (a numeric value) of the Date object into a GMT time string, returning a value similar to the following: Weds,15 June l997 14:02:02 GMT (the exact format varies depending on the operating system running on the computer)

ToLocaleString () converts the date (a numeric value) of the Date object into a string, using the specific date format configured on the computer

UTC () uses Date UTC (year, month, day, hour, minute, second) to return the date in milliseconds since 00:00:00 on January 1, 1970 (where hours, minutes, and seconds are optional)

B.7 document object

This object is a property of the window and frames objects and is a document displayed in a window or frame.

Attribute

Color of the alinkColor active link (ALINK)

Anchor a HTMI anchor, created using tags (the attribute itself is also an object)

Anchors array lists an array of document anchor objects () (the property itself is also an object)

Background color of the bgColor document (BGCOLOR)

A piece of information stored in a cookie.txt file by cookie, which is a property of the document object

The text color of the fgColor document (TEXT feature in tags)

A form in an form document (

) (the property itself is also an object)

Forms anay lists an array of form objects in the order in which they appear in the document (the property itself is an object)

The last modification date of the lastModified document

The color of the link to the linkColor document, that is, the LINK feature in the tag (link to a document that the user does not observe)

This is the end of a tag in the link document (the attribute itself is an object), "what objects and arrays does JavaScript have?" Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report