Paul Blackwood broke down the door of the woman's house and tried to have sex with her before leaving her on the floor, Wolverhampton Crown Court heard.
Mr Blackwood, of Parliament Street, West Bromwich, denies attempted rape.
Williams Davies QC, prosecuting, said the accused returned to try and rub evidence off the carpet with his shoe.
The prosecution said DNA collected from the carpet "precisely" matched that of the defendant after the attack on 30 November last year.
Mr Davies said the woman, who is now 102, was awoken by a banging noise in the night and assumed it was a porch door.
He said: "The banging had been the noise of the breaking open of the front door. Just as she got back to where her bed was the door of her bedroom smashed open."
The intruder pushed the woman to the floor and pulled off some of her clothes, the court was told.
The case continues.