I know that the stackoverflow community are strict with the questions but I have a need and I have never worked with geolocation , the thing is that I would like to know if there is a way to get a user's location by means of an event that is to say I have the following example code of what I need to do ..
<select id="countries">
<option value="United Stated">United Stated</option>
<option value="Canada">Canada</option>
<option value="Spain">Spain</option>
</select>
js file
$("#countries").on("change",function(){
/*en el evento on change del select me gustaria determinar
si el pais que el usuario elegio es verdaderamente su pais
es decir que determine su location mediante on change
y si no es su pais en verdad me mande una alerta con alguna
advertencia
*/
})
Any recommendations on how I could do what I want? If there is a library or framework that helps me with what I need to do, it would be great. if not someone could illuminate me an idea that methods exist to do what I want to be in javascript or php any tip I would appreciate a lot of thanks!