Home  >  Article  >  Web Front-end  >  How to use jQuery to dynamically modify hyperlinks

How to use jQuery to dynamically modify hyperlinks

PHP中文网
PHP中文网Original
2017-06-22 14:59:562026browse

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="

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/"));
});

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!

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