Use jQuery to make external links open in a new window

How to add target=”_blank” to all external links? I like the way using jQuery to make external links open in a new window…