The House Judiciary Committee gave overwhelming approval yesterday to a resolution that would grant full voting representation in both houses of Congress to District of Columbia residents.

Hundreds of city residents who jammed the committee room whooped and cheered at the 27-to-6 vote, which the District's nonvoting delegate, Walter E. Fauntroy, praised as "beyond my wildest dream."

The measure is expected to be voted on by full House around the end of February, and if it wins the needed two thirds approval, will go on to the Senate, where even its most enthusiastic supporters acknowledge that passage is in doubt.

A similar measure was passed by the Judiciary Committee on Dec. 2, 1975, by a vote of 23 to 10, but fell 45 votes short of the required two thirds majority on a 229-to-181 favorable vote in the House on March 23, 1976.

Fauntroy predicted that yesterday's lopsided vote will provide "the momentum to duplicate the margin" when the full House considers it.

He attribted the margin to "the indispensable support and moral leader ship" of President Carter; House Speaker Thomas P. (Tip) O'Neill. "who did his job" in influencing committee members, and Self-Determination for D.C., a coalition headed by City Coucil Chairman Sterling Tucker.

Fauntroy who sat on the edge of his front-row seat throughout much of the two-hour debate that receded the vote, leaped up and hugged Tucker and other supporters after the clerk announced vote.

Supporters on the committee, led by Rep. Don Edwards (D-Calif.), who sponsored the legislation and whose civil and constitutional rights subcommittee unanimously endorsed it last Oct. 31, rejected several attempts by opponents to return it to committee or narrow its scope through amendments.

Committee chairman Peter J. Rodino Jr. (D.N.J.) urged passage, saying Congress was "long past due recognizing this solemn right."

The committee approved one amendment, offered by Rep. M. Caldwell Butler (R.Va.). It specified that ratification of the needed constitutional amendment must occur within seven years of passage by Congress. Butler said he did not want a repeat of the attempt by supporters of the Equal Rights Amendment to extend the time period if the measures has not been approved by the legislatures of at least 38 states at the end of the seven years.

The committee voted down three other amendments by Butler that would have given the city something less than full voting representation in both the House and Senate.

Butler, who then voted for the resolution, said last night he will try to amend the proposal on the House floor to limit the city's voting representation to the House only.

"I don't think two-thirds of the senators will vote to expand membership in their club," said Butler, the ranking minority member on the sponsoring subcommittee. "I want to draw the line at what will pass." He added that he voted for the proposal, despite those reservation, "out of a sense of fair play."

Butler was on of five members who switched to a "yes" vote from a "no" in 1975. And four of those five - Democrats Walter Flowers of Alabama and James Mann of South Carolina, and Republicans Tom Railsbeck of Illinois and Butler - had been targeted by the Self-Determination coalition for major lobbying. The other no-to-yes switch was by Rep. Reorge E. Danielson (D-Calif).

Railsback said last night he changed his mind "after conversations with very good friends who are District residents." He said Richard Clark of the Self-Determination coalition and others convinced him that "it was presumptuous of me to impose my judgment . . . (that it is impossible for the measure to be ratified) for people who are fighting the cause who have decided to go for the whole works."

An aide to Rep. Mann, who said her boss' change of heart "made my day" because she lives in the District, said Fauntroy has been "lobbying him very hard for a year."

All eight new members of the committee who were present voted "yea," including the lone new Republican, Rep. Harold S. Sawyer of Michigan. "I realize that by voting for this I may be adding to the (Democratic) majority in both houses," Sawyer said. "But it's like free speech, It may be easier to support those you agree with," he said, but it wasn't possible to pick and choose on such a basic right.

Here is how the Judiciary Committee voted yesterday on the D.C. voting rights question: