The solution to the problem that importing js into html does not work: 1. Use script to import js external files, do not use links to import them; 2. When there is code in javascript that directly operates page elements, put js in the body Just quote it internally.
The operating environment of this article: Windows7 system, HTML5, Dell G3 computer
html does not take effect when introducing external js files?
First: Introduce external files to ensure normal introduction, that is, use script to introduce, do not use link to introduce
Second: In javascript, there are direct operations on page elements code, so it cannot be quoted in the head, but should be quoted in the body
Now the effect you want should come out.
【Recommended: HTML video tutorial】
The above is the detailed content of What should I do if the introduction of js into html does not take effect?. For more information, please follow other related articles on the PHP Chinese website!