I have an array and this code:
console.log(trips_array[0].outerHTML)
prints out this:
<trip origin="SFIA" destination="FRMT" fare="11.65" origTimeMin="7:47 AM" origTimeDate="07/23/2016 "
destTimeMin="9:18 AM" destTimeDate="07/23/2016" clipper="4.35" tripTime="">
<leg order="1" transfercode="N" origin="SFIA" destination="BALB" origTimeMin="7:47 AM" origTimeDate="07/23/2016"
destTimeMin="8:06 AM" destTimeDate="07/23/2016" line="ROUTE 2" trainHeadStation="PITT" trainIdx="8"/>
<leg order="2" transfercode="N" origin="BALB" destination="BAYF" origTimeMin="8:13 AM" origTimeDate="07/23/2016"
destTimeMin="8:54 AM" destTimeDate="07/23/2016" line="ROUTE 12" trainHeadStation="DUBL" trainIdx="8"/>
</trip>
How can I get the value of the attributes? For instance the trip origin and the leg origin?