I have a search bar on my page, but I need to move the code out into a separate js file in order to submit everything as a google browser extension. Right now it's written like this in the HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search</title>
<link rel="stylesheet" type="text/css" href="popup.css" />
</head>
<body>
<div id="searchContainer">
<script type="text/javascript">
function dos12(g1) {
window.open('https://www.google.com/#q=' + g1, '_self', 'G1window');
}
</script>
<form onsubmit="dos12(this.g1.value); return false;">
<input id="field" type="text" name="g1" size="20" placeholder="Google Search" autofocus="autofocus" />
<div id="delete"><span id="x">x</span></div>
<input id="submit" name="submit" type="submit" value="Search" />
</form>
</div>
</body>
</html>
I have moved other scripts out of the HTML and into js files, and put in <script src=> in their place, but this one has the form, onsubmit, and G1 value that I can't wrap my head around.
Any help would be massive. I have spent many hours so far :/