Home Web Front-end JS Tutorial When to use document and document.all_Basic knowledge

When to use document and document.all_Basic knowledge

May 16, 2016 pm 07:26 PM
document and


[Ctrl A Select all Note: If you need to introduce external Js, you need to refresh to execute ]

If with a The name attribute is set in the corresponding HTML tag of the form object, image object, and applet object. Its value will be used as the attribute name of the document object to refer to the corresponding object, but other objects cannot.
In addition, if input is used as a sub-element of form, it is wrong to directly use inputName or document.inputName to reference this object. You must use formName.inputName to reference, otherwise you can use inputName to reference.
In addition, you should I noticed that many commonly used elements do not have names.
If you want to reference an element with an id, you can only use Id or document.getElementById, document.all.id to reference it.
But for elements like this, so Like ...
can be used
linkid.href ;
linkname.href;
document.all.linkid.href;
document.all.linkname.href;
document.getElementById("linkid").href;
document.getElementsByName ("linkname")[0].href to quote

all is a collection that contains a collection of all html objects. Write a program that can access all objects. Like this:

Be careful to put the program after .
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

ASUS motherboard options compatible with R55600 (including R55600u and 5600h) ASUS motherboard options compatible with R55600 (including R55600u and 5600h) Jan 02, 2024 pm 05:32 PM

Which ASUS motherboard should be paired with the R55600? The ASUS ROGStrixB550-FGaming motherboard is an excellent choice. It is perfectly compatible with Ryzen55600X processor and provides excellent performance and features. This motherboard has a reliable power supply system, can support overclocking, and provides a wealth of expansion slots and ports to meet daily use and gaming needs. ROGStrixB550-FGaming is also equipped with high-quality audio solutions, fast network connections and reliable heat dissipation design to ensure that the system remains efficient and stable. In addition, this motherboard adopts a gorgeous ROG style and is equipped with gorgeous RGB lighting effects, adding visual enjoyment to your computer. All in all, ASUS ROGStri

Which one is better, Celeron g4900 or i36100? (Which one is better, Celeron g4900 or i34170?) Which one is better, Celeron g4900 or i36100? (Which one is better, Celeron g4900 or i34170?) Jan 01, 2024 pm 06:01 PM

Which one is better, Celeron g4900 or i36100? When it comes to the two processors Celeron G4900 and I36100, there is no doubt that the performance of I36100 is superior. Celeron processors are generally considered low-end processors and are primarily used in budget laptops. The I3 processor is mainly used for high-end processors, and its performance is very good. Whether you are playing games or watching videos, you will not experience any lagging when using the I3 processor. Therefore, if possible, try to buy Intel I-series processors, especially for desktop computers, so that you can enjoy the fun of the online world. How is the performance of the Celeron G4900T? From a performance perspective, the Pentium G4900T performs well in terms of frequency. Compared with the previous version, the CPU performance is

GTA 6 document gives a detailed overview of all leaks GTA 6 document gives a detailed overview of all leaks Sep 08, 2024 am 06:37 AM

On September 3, version 1.5 of the Grand Theft Auto VI document which provides a detailed overview of everything that is known about the game to date. The updated version of the document was announced in a trailer published on X (formerly Twitter).??

How to solve the problem that document.cookie cannot be obtained How to solve the problem that document.cookie cannot be obtained Nov 23, 2023 am 10:02 AM

Solutions for document.cookie not being obtained: 1. Browser privacy settings; 2. Same-origin policy; 3. HTTPOnly Cookie; 4. JavaScript code error; 5. Cookie does not exist or expires; 6. Cross-domain issues; 7. Viewer mode; 8. Server problems; 9. JavaScript execution timing; 10. Check console log, etc.

Which one is better, Huntkey s980 or Bauhaus (Huntkey Apollo or Lianli Bauhaus o11) Which one is better, Huntkey s980 or Bauhaus (Huntkey Apollo or Lianli Bauhaus o11) Jan 12, 2024 am 11:06 AM

Which one is better, Huntkey s980 or Bauhaus? Huntkey S980 and Bauhaus (BeQuiet) are two different brands of computer power supply (PSU) manufacturers. Which one is better to choose depends on your needs and personal preferences. It has been recognized and praised by consumers. Their products are widely used in personal computers, servers, industrial equipment and other fields. Huntkey is committed to providing high-quality power products and constantly introducing new technologies and innovative designs. Their products undergo strict quality control and testing to ensure they can power devices stably and efficiently. Huntkey also pays attention to environmental protection and energy conservation, and strives to reduce its impact on the environment. Their power supplies comply with international standards and have received multiple certifications and awards. As a reputable brand

How to turn off the mouse and keyboard lights after turning off the Gigabyte motherboard GA78LMTS2? (The mouse light cannot be turned off after the Gigabyte a88 motherboard is shut down) How to turn off the mouse and keyboard lights after turning off the Gigabyte motherboard GA78LMTS2? (The mouse light cannot be turned off after the Gigabyte a88 motherboard is shut down) Dec 26, 2023 pm 07:58 PM

How to turn off the mouse and keyboard lights when Gigabyte motherboard GA78LMTS2 is turned off? For help, please check whether there is "Deeppoweroffmode" in the BIOS, that is, deep power-down mode. This option is located in the Power settings option of the BIOS. If this option is set to enabled, the device will not light up after shutting down the computer. The differences between Gigabyte motherboard DLED and LED are as follows: 1. Different positions: direct-type DLED is behind the LCD panel, and the LED lights are arranged in a matrix; side In-type LED installs the LED lights at the frame of the panel so that the light source shines out from the side. 2. Energy saving: Side-in LED TVs save more power than direct-type DLED TVs. The difference between DLED and LED is that DLED

Find maximum sum of two array elements in Java Find maximum sum of two array elements in Java Sep 11, 2023 pm 02:13 PM

Twoelementsgivingthemaximumsuminanarraymeans,wehavetofindtwolargestarrayelementswhichwilleventuallygivethemaximumsumpossible.InthisarticlewewillseehowwecanfindthemaximumsumoftwoelementsinJava.ToshowyousomeinstancesThe Chinese translation of Instance-1 is: Example-1Supposewehaveth

Tokens to be listed: $DOGEL, $BRAIN, $BTD, $PINU and $PIMEME Tokens to be listed: $DOGEL, $BRAIN, $BTD, $PINU and $PIMEME Mar 03, 2025 pm 08:03 PM

The cryptocurrency market continues to develop, bringing investors a growing investment opportunity. The listing of new coins has always attracted much attention, and February 2025 is the month when new coins are crowded, providing investors with a wide range of choices. Cryptocurrencies to watch in February 2025: Potential projects that cannot be missed This article will focus on five cryptocurrency projects that will be launched in February, and whether you are an experienced investor or a newbie, you can find the projects you are interested in. They are DogeLife ($DOGEL), DistriBrain ($BRAIN), Bitcoin USD ($BTD), PiINU ($PINU) and PIMEME ($PIMEME). Please be prepared and put these days

See all articles