toggleAttr() method for jQuery