使用jquery添加到链接的href值

AJS*_*ift 3 jquery add href hyperlink

如何使用jquery在下面的链接值中添加一些地址?例如http://maps.google.com/maps?q=indianapolis

<div class="driving-directions-link">
<a href="http://maps.google.com/maps?q=">Get Direction</a>
</div>
Run Code Online (Sandbox Code Playgroud)

And*_*ker 5

$("div.driving-directions-link > a").prop("href", function (index, oldHref) {
    return oldHref + "indianapolis";
});
Run Code Online (Sandbox Code Playgroud)

退房.prop,这可以采取功能哪里oldHref好,旧href.

示例: http ://jsfiddle.net/c5VNK/