Home >Web Front-end >CSS Tutorial >Attached solution to the conflict between adding name and id to <a name> in htm page_Experience Exchange VIP Promotion

Attached solution to the conflict between adding name and id to <a name> in htm page_Experience Exchange VIP Promotion

PHP中文网
PHP中文网Original
2016-05-16 12:05:152263browse

it turns out that there is a conflict between and . i spent a long time and was very depressed. the temporary solution is to add a 2 to the following id, which is

the core code used in the solution is as follows
the following code is placed at the bottom of the page that’s it

<script language="javascript"> 
var url=location.href; 
var urlarr=url.split("#"); 
var theid=urlarr[1]; 
document.getElementById(theid+"2").style.color="yellow"; 
</script>
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