Early voting
'I Voted' stickers are seen during early voting at West Charlotte Public Library in Charlotte, North Carolina on 20 October, 2016 REUTERS/Chris Keane

As voters cast their vote for the next US president, they may be tempted to snap a selfie with their ballot, but depending on where they are, taking a selfie in the voting booth may not be legal. Taking a photo in a voting booth is currently legal in just 21 states and Washington DC, while the act is explicitly illegal in another 16 states. However, in 13 states, the laws regarding ballot selfies are still unclear.

Residents in the following states can take selfies with their ballots without worrying about legal repercussions: Connecticut, Hawaii, Idaho, Indiana, Kentucky, Louisiana, Maine, Massachusetts, Michigan, Minnesota, Montana, Nebraska, New Hampshire, North Dakota, Oregon, Rhode Island, Utah, Vermont, Virginia, Washington, Washington DC and Wyoming.

While taking a selfie of your own ballot is legal in all these states, taking a photo of another voter's ballot is illegal in Utah. The Associated Press reported that officials in Louisiana and Washington are not fond of ballot selfies.

However, voters in the following states should not take selfies with their ballots as it is illegal: Alabama, Alaska, Colorado, Florida, Georgia, Illinois, Kansas, Mississippi, Nevada, New Jersey, New Mexico, New York, North Carolina, South Carolina, South Dakota and Wisconsin.

In the remaining 13 states— Arizona, Arkansas, California, Delaware, Iowa, Maryland, Missouri, Ohio, Oklahoma, Pennsylvania, Tennessee, Texas and West Virginia—the law remains unclear and changes according to each specific state, according to Vox. Laws in these states widely differ, from banning photography specifically in the polling place, to prohibiting electronic devices at stations altogether.

Singer Justin Timberlake became the subject of a short-lived investigation in his home state of Tennessee after posting his own ballot selfie to encourage fans to vote. According to The Commercial Appeal, Vince Higgins, communications director for the office of Shelby County District Attorney General Amy Weirich, said he was wrong in saying Timberlake's selfie was under review in Memphis.

"The statement released earlier today by my office regarding Justin Timberlake and an investigation was incorrect and was released without my knowledge," Weirich said in a statement on Tuesday (25 October). "I am out of town at a conference. No one in our office is currently investigating this matter nor will we be using our limited resources to do so."

IBTimes UK breaks down what the law allows in these 13 states.