I want to get every link from my html code to load on click a div class content from an other page:
I just can’t get it right but I already got the first link…
This is my function:
$("a.button.view").click(function(e) {
links = $("a.button.view").attr('href');
e.preventDefault()
$(".wrapper-error").load(links + " .wrapper-order-details");
});
```
this is my html:
```
<a href="http://localhost:8080/account/view-order/426/" class="button view">View</a>
<a href="http://localhost:8080/account/view-order/427/" class="button view">View</a>
<a href="http://localhost:8080/account/view-order/428/" class="button view">View</a>
```
2
Answers
you can use jquery to achieve this
Using
map()
is shortest approach