Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>JS Bin</title>
    <!-- Algolia Places v1.4.18 -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/places.js/1.4.18/places.min.js"></script>
</head>
<body>
    <input type="search" id="address" placeholder="你想去哪" />
    <p>你選擇的位置: <strong id="address-value"></strong></p>
    <script>
        var placesAutocomplete = places({
            container: document.querySelector( "#address" ) // 輸入欄位
        });
        placesAutocomplete.on( "change", function(e) {
            document.querySelector( "#address-value" ).textContent = e.suggestion.value  // 選擇後賦予值得欄位
        });
    </script>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
hsuehmingfangpro
0viewers