This is because when you did
$('.myClass').css("position","absolute");
he added a style inline
A call to addClass will add a style style with a name from the stylesheet.
A css call will apply inline styles to the element.
To remove the style you applied with css , just do
$('.myClass').css("position","");
source share