<p id="demo"></p>
document.addEventListener("DOMContentLoaded", function() {
var x = document.getElementById("demo");
(function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}());
function showPosition(position) {
x.innerHTML = "Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude;
}
});
$(window).scroll(function(){
scrollValue = $(this).scrollTop();
if( scrollValue > 0){
$('.popup-promotion.user-ads-filter .container').css({'top' : scrollValue + 'px', 'margin-top' :'2%'});
} else {
$('.popup-promotion.user-ads-filter .container').css({'margin-top' : '2%'});
}
});
<div class="body">
<div class="popup-promotion user-ads-filter">
<div class="container">
</div>
</div>
</div>
var msg=$("form").serialize();
<form>
<input name="to" class="phone">
<input name="text" class="text">
</form>