Home >Web Front-end >HTML Tutorial >How to add elements to an html page_html/css_WEB-ITnose

How to add elements to an html page_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:48:491503browse

Without changing any element of an html page, how can I add a tag externally to the page table? Please give me some advice! ! !


Reply to the discussion (solution)

Change the external js introduced by html and use js to operate

Use js to add: $("# id").html("");

Change the external js introduced by html and use js to operate



html1 page cannot be added Any code can only be inserted externally. Can you give a small example?

Add with js: $("#id").html("");



But how to load js? Write another page?

What I mean is that html1 cannot have any changes. Write an html page externally, get the table first, and then insert a element


Add with js: $("#id").html("");



But how to load js? Write another page?

The first step: you write another js file and write the method in the file;
The second step: introduce this js file into html and call the js method when the page is loaded



Add with js: $("#id").html("");



But how to load js? Write another page?

The first step: you write another js file and write the method in the file;
The second step: introduce this js file into html and call the js method when the page is loaded This still requires changing the html page. . .

It does not affect the html layout. If you want to say that nothing is added to the html and the js method is not quoted, then I don’t think anyone can do this.

The poster is facing a problem Please state your initial needs instead of asking questions according to your ideas. Such questions will not get a good solution.

Use JavaScript DOM to add HTML elements, the premise is to add js in HTML:

There is something wrong with your design . You should change your way of thinking. Put your needs out and let everyone give you ideas

Write a page outside, use iframe to nest the original page, and use js to operate the sub-page.

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