add method attr to element