Skip to content

Instantly share code, notes, and snippets.

@chrislo2004
Last active September 20, 2017 07:05
Show Gist options
  • Save chrislo2004/e60d7f47c04cd3347aa3857bac98ac79 to your computer and use it in GitHub Desktop.
Save chrislo2004/e60d7f47c04cd3347aa3857bac98ac79 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<body>
<!--scripts first-->
<script>
function func2() {
var _mileageCalcA = 0.80
document.getElementById("id-label2").innerHTML = _mileageCalcA
}
document.querySelector('button').addEventListener('click', func2);
var _gmaps2WayDistance_number = 508
document.getElementById("id-label1").innerHTML = _gmaps2WayDistance_number
</script>
<p id="id-label1">TripDistance Should Show value 508.</p>
<button>Mileage charges per KM:</button>
<p id="id-label2">mileageCalcA.</p>
</body>
</html>
@klrkdekira
Copy link

klrkdekira commented Sep 20, 2017

fixed it for you

<!DOCTYPE html>
<html>
<body>
<p id="id-label1">TripDistance Should Show value 508.</p>

<button>Mileage charges per KM:</button>
<p id="id-label2">mileageCalcA.</p>
<script>
    function func2() {
      var _mileageCalcA = 0.80
      document.getElementById("id-label2").innerHTML = _mileageCalcA
    }
    
    document.querySelector('button').addEventListener('click', func2);
    var _gmaps2WayDistance_number = 508
    document.getElementById("id-label1").innerHTML = _gmaps2WayDistance_number
</script>
</body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment