title: selenium.common.exceptions.JavascriptException: Message: javascript error: Unexpected identifier
body: <p>very new to python and hoping to gain from your experience here, when using chrome (Developer Tools/console) this command works I am choosing option #1 on a pull down menu.</p>
  <pre class="lang-js prettyprint-override"><code> document.getElementById(&quot;Locations&quot;).selectedIndex = 1
   onEntitySelectChange(document.getElementById(&quot;Locations&quot;))
  </code></pre>
  <p>but when I convert this to my python using the following I get my error.</p>
  <pre class="lang-js prettyprint-override"><code>driver.execute_script(f'vars element = 
    document.getElementById(&quot;Locations&quot;).selectedIndex=&quot;1&quot;);')
     
  driver.execute_script(f'vars element = 
    onEntitySelectChange(document.getElementById(&quot;Locations&quot;));')
  </code></pre>
  <p>ERROR:</p>
  <pre><code>in check_response    raise exception_class(message, screen, stacktrace)
  selenium.common.exceptions.JavascriptException: Message: javascript error: Unexpected identifier
  </code></pre>
  <p>I have tried different inputs by removing &quot;1&quot; to just 1 removing the ';' but nothing seems to help.</p>