I have to append an connect ID towards the finish of links that visit a certain URL.

Here's what I've however i can't get results.

(this is in WordPress)

<script type="text/javascript">
jQuery(document).ready(function() {
   jQuery("a[href*=doitbest]").click(function() {
     this.append("?memberid=5705&associate=true");
   });
 });
</script>

Any ideas?

Presuming that the selector (a[href*=doitbest]) works, you could attempt:

jQuery(document).ready(function() {
   jQuery("a[href*=doitbest]").click(function() {
      href = $(this).attr('href');
      del = href.indexOf('?') > -1 ? '&' : '?';
      href += del + 'memberid=5705&associate=true';
      $(this).attr('href', href);
   });
});

This changes the href attribute, not the hyperlink text. I am unsure of that this is exactly what you would like, though. The del variable can be used to append the URL part by way of the & or ? char.

First, In my opinion make use of $(this) rather than this.

Additionally you desire to alter the Link to the hyperlink. The modification ought to be designed to href attribute, so

 $('a#my_link').click( function (event) {
  $(this).attr('href', $(this).attr('href') + '&id=1');
});