Home  >  Article  >  Web Front-end  >  How to get the text of a web page element when it does not have an id/name/? _html/css_WEB-ITnose

How to get the text of a web page element when it does not have an id/name/? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:12:341688browse

(1)a686372f31b1c1541c33f1045e729618 This is a checkbox

(2)77b6a8f91ff862815cd5db0d7c77f617"Player Regulations"63505a6f727f70c8bd4066f3066dcb9d

(3)24e169b73f5e71963f538a52301aa9b6100c88c5053bb3a2a94be7ccfbb16786cfe




These are the above three combined
(4)040c69b048c93b5c27e4a7afa7ee383afa237b25ec320aeaef2a8a75b4098256 I agree and accept d13e85553e13647da1eb86dd8bf78e46 DNF "Player Regulations"63505a6f727f70c8bd4066f3066dcb9d(1 yuan = 24e169b73f5e71963f538a52301aa9b6100d6620e049ff5237f36ebcce062759762 DNF points)0fe0b7695b8025b8365ca0c050e039db

For example, (3) I want to ask How to get the text without id/name/title? It is just "24e169b73f5e71963f538a52301aa9b6100d6620e049ff5237f36ebcce062759762" How about the text "100" here without id/name/title? Where to take it? ? Or how to rewrite its text? ?


Reply to discussion (solution)

<SPAN class=font_12 service="term"><INPUT id=rule onclick=change(); type=checkbox CHECKED value="" name=rule input> 本人同意并接受 <A href="http://dnf.qq.com/service/rules.htm" target=_blank>DNF《玩家条例》</A>(1元 = <FONT color=#ff6600>100</FONT> DNF点券)</SPAN><script>	var font = document.getElementsByTagName('font')[0];	alert( font.innerHTML )</script>	


What does the original poster mean?

HTML code

040c69b048c93b5c27e4a7afa7ee383aa686372f31b1c1541c33f1045e729618 I agree and accept d13e85553e13647da1eb86dd8bf78e46DNF...

I want to use my own program to change browsing The text in the browser window such as "24e169b73f5e71963f538a52301aa9b6100d6620e049ff5237f36ebcce062759762" changes the 100 here
but this html code does not have an id/name... Can it be changed? Others have id/names. . You can change the value of the text

Go check out the API yourself, jQuery's selector


What is the type of API that controls the web page called?
Go check out the API yourself, jQuery’s selector

I don’t understand what you are trying to say at all
http://www.css88.com/jqapi/index.html

I don’t understand what you want to say at all
http://www.css88.com/jqapi/index.html
This guy got it through the jquery plug-in. jquery implements it in a more comprehensive way. The methods I listed.

There are many ways to get DOM elements, such as through ID, through tags, through special attributes, through CSS classes, tracing parent elements through child elements, and traversing child elements through parent elements. The effect you want can be achieved in the following ways accomplish.

<script>    var font = document.getElementsByTagName('font')[0];    alert( font.innerHTML )</script>

It’s best to use jquery’s selector directly. It’s very simple

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