Story highlights New law goes into effect October 25

It's designed to reduce pedestrian accidents

(CNN) When you cross the street in Honolulu, look both ways -- but NOT at the life-changing text your best 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 October 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," the mayor said. "But sometimes we lack common sense."

Read More