title: Create cookie for div
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://www.gstatic.com/firebasejs/4.11.0/firebase.js"&gt;&lt;/script&gt;
  &lt;script&gt;
    // Initialize Firebase
    var config = {
      apiKey: "AIzaSyCWZjRe2CK8Hu2VN35AgZOQ7lQZKcI-UWM",
      authDomain: "carrier-35d7c.firebaseapp.com",
      databaseURL: "https://carrier-35d7c.firebaseio.com",
      projectId: "carrier-35d7c",
      storageBucket: "carrier-35d7c.appspot.com",
      messagingSenderId: "827792028763"
    };
    firebase.initializeApp(config);
  &lt;/script&gt;
  
  
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;&lt;/title&gt;
    
    &lt;script src="https://cdn.firebase.com/libs/firebaseui/2.3.0/firebaseui.js"&gt;&lt;/script&gt;
    &lt;link type="text/css" rel="stylesheet" href="https://cdn.firebase.com/libs/firebaseui/2.3.0/firebaseui.css" /&gt;
    &lt;link href="auth.css" rel="stylesheet" type="text/css" media="screen" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
  
   &lt;div id="container"&gt;
        &lt;h3&gt;&lt;/h3&gt;
        &lt;div id="loading"&gt;&lt;/div&gt;
        &lt;div id="loaded" class="hidden"&gt;
          &lt;div id="main"&gt;
            &lt;div id="user-signed-in" class="hidden"&gt;
              &lt;div id="user-info"&gt;
                &lt;div id="photo-container"&gt;
                  &lt;img id="photo"&gt;
                &lt;/div&gt;
                &lt;div id="name"&gt;&lt;/div&gt;
                &lt;div id="email"&gt;&lt;/div&gt;
                &lt;div id="phone"&gt;&lt;/div&gt;
                 &lt;script&gt;document.cookie = document.getElementById("phone").innerHTML;
               &lt;/script&gt;
                &lt;div class="clearfix"&gt;&lt;/div&gt;
              &lt;/div&gt;
              &lt;p&gt;
                &lt;button id="sign-out"&gt;Sign Out&lt;/button&gt;
                &lt;button id="delete-account"&gt;Delete account&lt;/button&gt;
              &lt;/p&gt;
            &lt;/div&gt;
            &lt;div id="user-signed-out" class="hidden"&gt;
              &lt;h4&gt;You are signed out.&lt;/h4&gt;
              &lt;div id="firebaseui-spa"&gt;
                &lt;h3&gt;&lt;/h3&gt;
                &lt;div id="firebaseui-container"&gt;&lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;script src="auth.js"&gt;&lt;/script&gt;
  
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Geolocation&lt;/title&gt;
      &lt;meta name="viewport" content="initial-scale=1.0, user-scalable=no"&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;style&gt;
        /* Always set the map height explicitly to define the size of the div
         * element that contains the map. */
        #map {
          height: 100%;
        }
        /* Optional: Makes the sample page fill the window. */
        html, body {
          height: 100%;
          margin: 0;
          padding: 0;
        }
      &lt;/style&gt;
      &lt;!-- Place this inside the HTML head; don't use async defer for now --&gt;
  &lt;script src="https://www.gstatic.com/firebasejs/4.12.1/firebase.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdn.firebase.com/libs/geofire/4.1.2/geofire.min.js"&gt;&lt;/script&gt;
  
    &lt;script&gt;
          
          var config = {
      apiKey: "AIzaSyCWZjRe2CK8Hu2VN35AgZOQ7lQZKcI-UWM",
      authDomain: "carrier-35d7c.firebaseapp.com",
      databaseURL: "https://carrier-35d7c.firebaseio.com",
      projectId: "carrier-35d7c",
      storageBucket: "carrier-35d7c.appspot.com",
      messagingSenderId: "827792028763"
    };
          if (!firebase.apps.length) {
              firebase.initializeApp(config);
          }
          
          //Create a node at firebase location to add locations as child keys
          var locationsRef = firebase.database().ref("locations");
          
          // Create a new GeoFire key under users Firebase location
          var geoFire = new GeoFire(locationsRef.push());
        &lt;/script&gt;
  
  
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div id="map"&gt;&lt;/div&gt;
      &lt;script&gt;
        // Note: This example requires that you consent to location sharing when
        // prompted by your browser. If you see the error "The Geolocation service
        // failed.", it means you probably did not give permission for the browser to
        // locate you.
        var map, infoWindow;
        var lat, lng;
        function initMap() {
          map = new google.maps.Map(document.getElementById('map'), {
            center: {lat: -34.397, lng: 150.644},
            zoom: 18
  
          });
          infoWindow = new google.maps.InfoWindow;
          // Try HTML5 geolocation.
          if (navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(function(position) {
              lat = position.coords.latitude;
              lng = position.coords.longitude;
              var pos = {lat: lat, lng: lng };
                  _setGeoFire();
                var locationsRef = firebase.database().ref("locations");
  locationsRef.on('child_added', function(snapshot) {
    var data = snapshot.val();
    var x = document.cookie;
    var markerLabel = x;
    var marker = new google.maps.Marker({
      position: {
        lat: data.User.l[0],
        lng: data.User.l[1]
  
  
      },
      map: map,
      label: markerLabel
    });
    bounds.extend(marker.getPosition());
    marker.addListener('click', (function(data) {
      return function(e) {
        infowindow.setContent(this.getPosition().toUrlValue(6) + "&lt;br&gt;" + data.User.g);
        infowindow.open(map, this);
      }
    }(data)));
    map.fitBounds(bounds);
  });
            
              infoWindow.setPosition(pos);
              infoWindow.setContent('Current Location');
              infoWindow.open(map);
              map.setCenter(pos);
            }, function() {
              handleLocationError(true, infoWindow, map.getCenter());
            });
          } else {
            // Browser doesn't support Geolocation
            handleLocationError(false, infoWindow, map.getCenter());
          }
        }
        function handleLocationError(browserHasGeolocation, infoWindow, pos) {
          infoWindow.setPosition(pos);
          infoWindow.setContent(browserHasGeolocation ?
                                'Error: The Geolocation service failed.' :
                                'Error: Your browser doesn\'t support geolocation.');
          infoWindow.open(map);
        }
        function _setGeoFire(){
      geoFire.set("User", [lat, lng]).then(()=&gt;{
              console.log("Location added");
          }).catch(function(error) {
              console.log(error);
          });
  }
      &lt;/script&gt;
      &lt;script 
      src="https://maps.googleapis.com/maps/api/js?key=AIzaSyD2nPlSt_nM7PSKD8So8anbUbBYICFWcCA&amp;callback=initMap"&gt;
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I created a phone number authentication system. The user enters their phone number and it sends a code to the phone that the user enters that code on the site and that's how they are authenticated. I want to capture what number they type into the site. I created a cookie under the div 
  "phone" to capture the phone number. I want to show all the user's location using markers on a google map and I want the google map marker to display the individual phone number assigned to that user so in my other file I created a variable that had the value of the cookie. I then made the marker label that variable and I thought the phone number would appear but nothing shows up for the marker label.I don't know what to do, if anyone can help me with this I would really appreciate it.<a href="https://i.stack.imgur.com/aUV75.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aUV75.png" alt="enter image description here"></a></p>