Image copyright Alamy Image caption The 'Who shot JR?' storyline in Dallas in 1980 had the US transfixed

Soap opera was once the mainstay of television entertainment, and their characters part of everyday conversation. Now there are only four such programmes on air in the US. What happened?

In 1969, there were 18 daytime soap operas on US television. Now there are only four.

The Bold and the Beautiful, Days of Our Lives, General Hospital and The Young and the Restless are the only ones left standing, to the disappointment of soap fans.

"That sense of community and television, I think, has disappeared in this country," said Joan DeJean, a trustee professor at the University of Pennsylvania, who has fond memories of gathering around the TV with friends after lunch when at college.

The genre was first established in the 1930s on radio, sponsored by detergent companies such as Procter and Gamble and Colgate-Palmolive, and they became known for their bad scripts and high drama, hence the name.

They were initially used as a vehicle to advertise household products to women, says Miriam Berg, an assistant professor in residence at Northwestern University in Qatar.

The migration to television happened in the 1950s and eventually to primetime, although these were more likely to be once a week.

One of the most famous moments in soap history came in 1980 when JR Ewing was left a bloody mess on his office floor in the weekly primetime show Dallas.

The armed assailant's identity was kept under wraps for months until the next episode, and the intervening summer was filled with speculation - there were T-shirts and other merchandise asking the question everyone was asking. Who shot JR?

Image copyright Getty Images Image caption The country was gripped by the OJ Simpson trial

It employed the classic soap opera device - the cliffhanger - to maximum effect.

About 350 million people around the world tuned in to find out the answer - it was Kristin, JR's sister-in-law.

The reason for the growth of soap operas during the 1990s was its continuous narrative format, which meant that these shows would run for decades, leaving viewers hung up at the end of each episode.

"There is no ending prescribed, they can go on for years, decades," says Ms DeJean.

Soaps dealt with controversial social issues in a more developed and thoughtful way than earlier forms of television, says Elana Levine, a professor in the department of journalism, advertising and media studies at the University of Wisconsin-Milwaukee, which included abortion, race relations, sexuality and generational conflicts.

"You really delve into personal relations, emotions, romance," says Ms Berg.

But the end was nigh.

C Lee Harrington, a professor of sociology at Miami University, says the OJ Simpson trial in 1995 was a major factor in the soap opera's decline.

The trial was televised for months, taking daytime soaps off the air, and they never fully recovered, says Ms Harrington.

Added to that, she says, the trial gave viewers a glimpse of a world of entertainment that could more than match a soap - the real lives of the rich and famous.

Today, there are few clearer examples of that than Keeping Up with The Kardashians, which has been going on for just over a decade.

Image copyright Alamy Image caption Britain was gripped when Charlene and Scott tied the knot on Neighbours in 1987

What is ironic is that the lawyer in the OJ Simpson trial was a Kardashian family member.

Ms Harrington says the Kardashians are a current example of an ongoing narrative that audiences are emotionally invested in. She says that people who follow the Kardashians tend to follow them as if they're a fictional family.

"Perhaps some of what shows on [keeping up with the Kardashians] is fictionalised, no doubt, but it's a soap opera," said Ms Harrington.

"The romances, the betrayal, the divorce, the birth, the affairs, we are engaged in many similar ways with celebrity culture that we used to be with fictional narrative in the daytime."

Another reason that reality television took off in the 1990s was that it was much cheaper to produce than a soap opera, says Ms Harrington.

Budget cuts had hit TV soaps hard, due to the significant amount of money that was spent on clothes, remote shooting and the set decoration. After the spending cuts, the quality of programmes declined, and directors and writers began to quit.

Reality television became the new king, but there are soaps that have endured.

Days of Our Lives on NBC, which tells the story of the Horton family and their friends, has been going since the 1960s, with 55 seasons now under its belt. Some of its audience has grown old with the show, says Ms Levine.

Viewers who grow up with characters become very attached to them, she adds.

"Sometimes these people bring in new viewers. They'll introduce their children and their grandchildren."

Image copyright Alamy Image caption Bold and the Beautiful cast in 1987

But demographics tell part of the story of soaps' decline - they are no longer attracting new audiences and viewers are getting older. Part of the reason, some believe, is shorter attention spans.

"People just wanted shorter narratives, they wanted shorter books," says Ms Harrington.

In the past, broadcast television would devote four hours of airing per day for soap operas across each network, while now it's just an hour or 90 minutes each, says Ms Levine.

A similar decline in soaps can be seen in other countries.

The UK has two of the longest running soaps in the world - The Archers (radio) and Coronation Street.

Media playback is unsupported on your device Media caption Valley of the Wolves is such a hit that the normally chaotic streets of the capital Kabul are deserted when it is on air

A few years after the JR Ewing storyline gripped the British, another foreign import began broadcasting from Australia.

Neighbours was on BBC One twice a day and enjoyed a huge student audience in the UK - at its height in the early 1990s its characters were household names. It is still broadcast but to a much smaller number of viewers on Channel 5, and its future in the UK has been in dispute.

Experts predict that soaps will adapt to the new challenges, migrating to streaming platforms like Amazon and Netflix where - with some irony - the serial format is king.

"Today, the most popular television programming is serialised," says Levine. "That legacy comes from soap opera."