HONOLULU — Honolulu this week became the largest city in the U.S. to make it illegal for people to look at cellphones, tablets or video games while crossing a road or highway.

It comes as a few states still have not outlawed texting while driving.

It remains to be seen how the law can be enforced on an island that draws tourists from around the globe. The tourism industry is trying to educate visitors, but a smattering of tourists interviewed Wednesday – the day the law took effect – said they had no clue.

Amy Pawlowski, who was visiting from Phoenix, had not heard about the new restrictions on mobile devices. “It seems as though the enforcement aspect would be quite difficult and almost that the government efforts would be better spent with the law prohibiting drivers from being on their phones while driving,” she said just after glancing at her phone while crossing a Waikiki street. “Perhaps they (pedestrians) are using a navigation device that is helping them navigate Waikiki or Honolulu.”

The law applies to the entire island of Oahu, where it is also illegal to drive while using handheld mobile electronics. A first offense for the distracted walking ordinance carries a fine of between $15 and $35. It increases to between $75 and $99 for a third offense within a year of the first violation.

Officers in tourist-heavy Honolulu have discretion to issue a warning or a ticket, police spokeswoman Michelle Yu said.

“We realize not everyone is going to know,” she said. “Local laws could vary.”

The National Safety Council, which has been looking at the issue of distracted walking since 2015, praised Honolulu for being a leader on the issue. The small Idaho city of Rexburg passed an ordinance in 2011 making it illegal to text while driving or crossing a street or highway. Other cities have considered similar measures.

Honolulu’s ordinance aims to reduce the number of injuries after the state ranked as the 13th most dangerous for pedestrians from 2010 to 2014, said Honolulu Councilman Brandon Elefante, who wrote the measure.

Elefante said he pushed the measure partly because a high school in his district with nearly 2,500 students is on a busy highway. Students at Waipahu High School did a survey and found 1,000 classmates in a 20-minute period jaywalked, crossed against traffic lights and used electronic devices while crossing, he said.

The law went into effect 90 days after the mayor signed it in July. During the 90 days, police say they have passed out informational fliers across the island.

Jim Cartisser, a tourist from Twin Falls, Idaho, said getting a ticket while on vacation “could leave a lot of people with a sour taste in their mouth leaving Honolulu.”