The Taj Mahal is in Agra in the state of Uttar Pradesh, and it is a popular place visited by tourists from around the world.
You can go to Agra from either Delhi or Jaipur. Traveling by car from Delhi to Agra the distance is 233km which would take you about 4 hours to reach and from Jaipur to Agra the distance is 240km which would take you 4.17 minutes to reach. So both destinations are pretty much at the same distance from Agra.
You can travel to Agra three different way by air, rail or car.
Jaipur, Delhi, and Agra all have an airport, and you can get a flight to Agra from any of the two destinations. The Agra airport is 7km from the main Agra city and 12.7 km from the Taj Mahal. Going by air would also be the fastest way of reaching Taj Mahal from either Delhi or Jaipur.
There are many trains which are connected to Agra from Delhi and Jaipur. Agra has three railway stations Agra Cantonment station, Raja Ki Mandi station and Agra Fort station.
When traveling by road to Agra you can either hire a taxi or take a bus. The main bus stand in Agra is Idgah from where you will find many buses going and coming from different cities like Delhi and Jaipur.