JavaScript on the Enter key in a text box and Value Submit | Trigger a Button Click on Enter

<input id="xxInput" value="Some text.."> <button id="xxBtn" onclick="javascript:alert('Hello Sam!')">Button</button> <script> var input = document.getElementById("xxInput"); input.addEventListener("keyup", function(event) {     event.preventDefault();     if (event.keyCode === 13) {        …

Continue ReadingJavaScript on the Enter key in a text box and Value Submit | Trigger a Button Click on Enter

Get City Name Using Google Geolocation

<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.3.js"></script> <script type="text/javascript">     navigator.geolocation.getCurrentPosition(success, error);     function success(position) {         var GEOCODING = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' + position.coords.latitude + '%2C' + position.coords.longitude + '&language=en';…

Continue ReadingGet City Name Using Google Geolocation