Isn't that the plot to a Jimmy Neutron episode? 

Edit: It was indeed similar to the plot of the first episode, in which self folding pants gained sentience. Thank you all for informing me. Have a wonderful day!