cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

  <label>Seu nome
    <input type="text" name="nome">

  <label>Seu email
    <input type="email" name="email">

    <legend>Seu endereço</legend>
    <button class="small" onclick="preencher()" type="button"> Preencher com minha localização atual</button>
      <input type="text" name="rua">
      <input type="text" name="numero">
      <input type="text" name="cidade">
      <input type="text" name="cep">

  <button class="success">Enviar</button>
              body {
  margin: 1em auto;
  background: #f0f0f0;
  max-width: 400px;

fieldset legend {
  background: #f0f0f0;
              function preencher() {
  if ("geolocation" in navigator) {
    navigator.geolocation.getCurrentPosition(function(posicao) {
      var url = "http://nominatim.openstreetmap.org/reverse?lat="+posicao.coords.latitude+"&lon="+posicao.coords.longitude+"&format=json&json_callback=preencherDados";
      var script = document.createElement('script');
      script.src = url;
  } else {
    alert('seu navegador não suporta geolocation');

function preencherDados(dados) {
  document.querySelector('[name=rua]').value = dados.address.road;
  document.querySelector('[name=numero]').value = dados.address.house_number;
  document.querySelector('[name=cidade]').value = dados.address.city;
  document.querySelector('[name=cep]').value = dados.address.postcode;  
Loading ..................