Reputation: 11
I'm getting a syntax error from the code below:
(function({
var resultsDIV = document.getElementById("results"),
searchInput = document.forms[0].search,
currentSearch = ''
;
I have tried all sorts of ways of writing this line but continue to get the same error.
The actual error I am getting is:
"Syntax Error: missing : after property id"
Can anyone help?
Upvotes: 1
Views: 176
Reputation: 2103
For me miss ;
or you not declared the id in one tag.
Example:
<p id="po"></p>
After with the update's question:
(function(){
var resultsDIV = document.getElementById("results");
searchInput = document.forms[0].search;
currentSearch = '';
})();
Upvotes: 0