Check the target attribute and respond accordingly