Home > Web Front-end > JS Tutorial > body text

How to use jQuery to dynamically modify hyperlinks

PHP中文网
Release: 2017-06-22 14:59:56
Original
2028 people have browsed it

The example in this article describes the method of dynamically modifying the hyperlink address with jQuery. Share it with everyone for your reference. The specific implementation method is as follows:

html code is as follows:

<a id="php" href="
Copy after login

Replace the link address of this hyperlink through jQuery to http://www.php.cn /xiazai/, the code is as follows:

$("button").click(function(){
$("#jb51").attr("href","http://www.php.cn/xiazai/"));
});
Copy after login

The above is the detailed content of How to use jQuery to dynamically modify hyperlinks. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!