Home >Web Front-end >JS Tutorial >JavaScript uses Dom to change the value of the text box in front of the hyperlink_javascript skills

JavaScript uses Dom to change the value of the text box in front of the hyperlink_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:09:351213browse

Using the DOM tree, you can modify related content without using the ID, such as modifying the value of the text box in front of each hyperlink.


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

Here we mainly use the previousSibling attribute to access The previous node, thereby achieving the effect of changing the value of the previous text box.
Statement:
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