Skip to content

Commit

Permalink
mascara formatacao telefone
Browse files Browse the repository at this point in the history
  • Loading branch information
renatomb committed Dec 13, 2023
1 parent 6fce8ff commit 905775a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions _posts/guidelines/2019-02-19-frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,20 @@ revisao: 2023-11-19
</script>
```

### Formatar um campo de texto para o formato telefônico brasileiro

```html
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.10/jquery.mask.js"></script>
</head>
<body>
<input type="text" id="telefone" name="telefone" placeholder="Informe o seu telefone" onclick="this.select();" size="30" maxlength="15" onkeypress="$(this).mask('(00) 00000-0000')" autocomplete="off" required>
</body>
</html>
```

## Validadores de código

* [W3C Markup Validation Service](https://validator.w3.org/)
Expand Down

0 comments on commit 905775a

Please sign in to comment.