I am trying to figure out how to have 2 spans combine information to output on screen.
I get parts of the output correct, but i can't find where to put the added text from the second span to complete it properly. I've moved the 0 mi), around but cannot get it to come up when the # of miles is presented to the screen. My output is "Asian Art Museum (3486.4 I cannot get the mi) to add the the output.

      <li><a href="http://www.asianart.org/" target="_blank">Asian Art Museum</a><span id="geo1"> (</span><span id="distance1"> 0 mi)</span></li>
      <li><a href="http://bit.ly/93E5VI" target="_blank">City Hall</a><span id="geo2"> (</span><span id="distance2"> 0 mi)</span></li>
      <li><a href="http://heartofthecity-farmersmar.squarespace.com/" target="_blank">Heart of the City Farmer's Market</a><span id="geo3"> (</span><span id="distance3"> 0 mi)</span></li>
      <li><a href="http://www.sfcablecar.com/" target="_blank">Cable Car turnaround</a><span id="geo4"> (</span><span id="distance4"> 0 mi)</span></li>
      <li><a href="http://www.flysfo.com/" target="_blank">San Fran Int'l Airport</a><span id="geo5"> (</span><span id="distance5"> 0 mi)</span></li>

Recommended Answers

All 3 Replies

Are you trying to update the value client side? If so, you can use some javascript. here is an example...

    <a href="#" >Asian Art Museum</a> ( <span id="distance1">0</span> mi )

    var dist1 = document.getElementById("distance1")
    dist1.innerText = 3486.4

Yeah, thank you, i can see it now. I was confused and had the 0 mi) all together, instead of spreading it out properly in my inline statement.

So has this info solved your issue or do you need more assistance?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.