item is a function, not an object, so you must call it:
By the way, getElementsByTagName returns HTMLCollection and you can get single item also in this way:
Finally, you incorrectly compare whether the target equals _blank. You used "=" which means you are assigning this value. You must use "==" or "===" operator. Please refer to the MDN documentation.