Twitter uses JQuery, so a way to do this, assuming that you aren't doing this so much as to trigger the rate limits (the rate limits will apply more aggressively to web client users as compared to API users) is to do the equivalent of:
$('.button.follow-button').click()
You can accomplish this in GreaseMonkey if you'd like, or setting it as a JavaScript bookmarklet, or by copy-pasting this into your address bar and hitting enter:
javascript:$('.button.follow-button').click()