Petra has become increasingly popular as a daytrip from Israel, which is just across the border from Aqaba, and even from Egypt a little farther across the Red Sea.
By air: flying to Petra means catching a plane to Aqaba airport to the north of the city, just an hour by land to Petra. From Amman airport, expect a journey that is about three hours, depending on traffic. The only domestic route in Jordan is the Amman-Aqaba flight so getting to Petra by air is not considered a viable option usually.