sf-f52 / index.html
jordonpeter01's picture
Update index.html
6b5a736 verified
raw
history blame
1.85 kB
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Barra de Pesquisa Estilo Google</html>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="<KEY>" crossorigin="anonymous">
<style>
.container {
padding: 20px;
text-align: center;
}
#search-bar {
width: 100%;
padding: 15px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 16px;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>Barra de Pesquisa Estilo Google</h1>
<input type="text" id="search-bar" placeholder="Procure algo...">
<button onclick="executeSearch()" class="btn btn-primary mt-3">Pesquisar</button>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="<KEY>" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="<KEY>" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="<KEY>" crossorigin="anonymous"></script>
<script>
function executeSearch() {
const searchBar = document.getElementById('search-bar');
const searchTerm = searchBar.value;
if (searchTerm) {
window.location.href = `https://www.google.com/search?q=${searchTerm}`;
} else {
alert('Digite algo na barra de pesquisa!');
}
}
</script>
</body>
</html>