Edit The Code:
See Result »
Try it Yourself - ©
w3big.com
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="http://cdn.static.w3big.com/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("#w3big").attr({ "href" : "http://www.w3big.com/jquery", "title" : "jQuery 教程" }); }); }); </script> </head> <body> <p><a href="http://www.w3big.com" id="w3big">本教程</a></p> <button>修改 href 和 title</button> <p>点击按钮修改后,可以查看 href 和 title 是否变化。</p> </body> </html>