From Marketwatch:
When interest rates rise, bond prices fall so that existing bond yields will match the yields of newly issued bonds (with similar ratings) with higher interest rates. The higher the yield, the more the bond will decline in value when rates rise, and increase in value when rates drop.
But that doesn’t necessarily hold true for stocks with attractive dividend yields, since companies may still be growing their businesses or have plenty of cash flow to support increasing dividends.