Lawyers for John W. Hinckley Jr., who attempted to assassinate President Reagan, have asked a U.S. District judge for permission to videotape prospective testimony of actress Jodie Foster because Foster will be out of the country for several months, according to knowledgeable sources.

Hinckley's lawyers made the request to use videotaped testimony to the presiding judge, Barrington D. Parker, in a closed, hour-long hearing Wednesday, the sources said. Parker has not ruled on the request.

The prosecution and the defense are expected to file written arguments on the matter soon, but it was not clear yesterday whether the government was opposing the idea. Parker has ordered all documents bearing on the matter sealed, apparently to minimize publicity. Foster received anonymous threats last year after some statements by Hinckley regarding her.

Foster is scheduled to leave the country to work in Europe sometime next week, according to one source. It was unclear whether either side had proposed a specific date or site for taking her testimony in the event that Parker granted the request.

No date has been set for Hinckley's trial. The prosecution is appealing a three-judge federal appeals court ruling that would exclude certain evidence, but it is not known how long that appeal will delay the trial.

Hinckley has admitted firing shots that wounded President Reagan, press secretary James Brady, a Secret Service agent and a D.C. police officer. The only issue to be decided at the trial is whether Hinckley was insane at the time. He is said to have made the assassination attempt to win Foster's attention and had talked with Foster on the phone several times before the attempt on Reagan's life.

The defense lawyers, Vincent Fuller and Greg Craig, apparently hope that Foster's testimony would support their contention that Hinckley was insane at the time of the shootings, sources said.