This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

HONOLULU — When crossing the street in Honolulu, look both ways — but not at the life-changing text a friend just sent.

The city just approved a law making it illegal for pedestrians to “cross a street or highway while viewing a mobile electronic device.”

The law covers video games, pagers and laptops, and the ubiquitous smartphones.

The law goes into effect Oct. 25, giving police time to explain the situation to people who can’t take their eyes off that tiny screen in their hands.

The distracted pedestrian law is needed because so many people in the city — especially seniors — are hit by vehicles in crosswalks, Honolulu Mayor Kirk Caldwell said at a bill-signing ceremony at one of the city’s busiest intersections.

“Sometimes I wish there were laws we did not have to pass, that perhaps common sense would prevail,” Caldwell said. “But sometimes we lack common sense.”

Police will have to observe somebody looking at their device to make an arrest.

Fines will be $15 to $35 for the first offense, $35 to $75 for the second and $75 to $99 for the third.

It will still be legal to talk on phones while crossing a street or to look at phones on the sidewalk.

Almost every state has a law against texting while driving, but Honolulu appears to be the first major city in the United States to go after pedestrians who use hand-held devices, Caldwell said.

High school safety clubs suggested the idea and did studies on pedestrian safety, said Kel Hirohata, a high school teacher.

He said students foresaw a perfect storm.

“What if the person that is driving … is looking a their phone and the pedestrian crossing the street is also doing the same thing? Anything can happen,” Hirohata said.

Hirohata said his discussions with other students convinced him the law was needed, not just increased safety education. He said many students asked, “Is this a law? No? Then why should I care?”

Honolulu’s concerns might be supported by the Governors Highway Safety Association, which reported pedestrian fatalities increased 11 percent from the first six months of 2015 to the same period in 2016.

One of the possible reasons: Distraction because of growing use of smartphone technology.

Honolulu isn’t the first city to address the dangers of texting and walking.

In 2008, London put special pads around lamp posts on Brick Lane, making it the first Safe Text street in the United Kingdom.

LONDON – MARCH 04: In this photo illustration, two pedestrians walks past padded lamp posts whilst texting in Brick Lane on March 4, 2008 in London, England. Brick Lane has become the first ‘Safe Text’ street in the UK. the padded lamp posts have been introduced to combat the 6.5 million street injuries that occur from walking and texting. (Photo by Micha Theiner/Getty Images)