Sha256: 00faccd96d298519d22c89e421570ec016a03d04c3c2a2ac224d23973fa97358
Contents?: true
Size: 519 Bytes
Versions: 10
Compression:
Stored size: 519 Bytes
Contents
const searchForm = document.getElementById('SearchTermForm'); const searchUrlPath = 'https://www.kcc.edu/search'; function submissionHandler(e) { const target = e.target; const searchString = encodeURIComponent(target.querySelector('#searchTermInput').value); const searchQuery = `?q=${searchString}` e.preventDefault(); return window.location = new URL(searchUrlPath + searchQuery); } function websiteSearch() { searchForm.addEventListener('submit', submissionHandler); } export default websiteSearch;
Version data entries
10 entries across 10 versions & 1 rubygems