If you want to get all link using jQuery then you can use this code easily. Here is code which get all link using each function then check , if value is something and you want to change it.

<script type="text/javascript">
$('a').each(function() {
var value = $(this).attr('href');
$(this).attr('href', 'http://youtube.com');

if you face any problem then please inform me.