JavaScript - Please Necesito un Boton Copy

 
Vista:
sin imagen de perfil

Please Necesito un Boton Copy

Publicado por Diego (1 intervención) el 07/09/2016 15:49:24
Porfavor ayudenme
Necesito Copiar los dos numeros con nueva linea NL con un boton.
No importa si se modifica en input o cualquier cosa.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 5px; padding: 5px }
#map_canvas {width: 200px; height: 500px;}
</style>
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?v=3.exp">
</script>
<script type="text/javascript">
function getCoords(marker){
document.getElementById("loglat").innerHTML=marker.getPosition().lat();
document.getElementById("loglong").innerHTML=marker.getPosition().lng();
}
function initialize() {
var myLatlng = new google.maps.LatLng(-17.379089795112268,-66.14776038357547);
var myOptions = {
zoom: 16,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
}
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

marker = new google.maps.Marker({
position: myLatlng,
draggable: true,
title:"Hello World!"
});
google.maps.event.addListener(marker, "dragend", function() {
getCoords(marker);
});

marker.setMap(map);
getCoords(marker);


}
</script>
</head>
<body onload="initialize()">
<p>
<div id="map_canvas" style="width:1300px; height:540px"></div><br>
<font color="#000000">Latitud:<strong id="loglat"></strong></font>
<br>
<font color="#000000">Longitud:<strong id="loglong"></strong></font>
</p>
</body>
</html>

!Gracias de Antemano.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder