title: How to click a button in Selenium WebDriver with Java using jQuery
body: <p>I have the following HTML:</p>
  
  <pre><code>&lt;button class="gbqfba" name="btnK" aria-label="Google Search" id="gbqfba"&gt;&lt;span id="gbqfsa"&gt;Google Search&lt;/span&gt;&lt;/button&gt;
  </code></pre>
  
  <p>My following code for clicking "Google Search" button is working well using java in WebDriver:</p>
  
  <pre><code>driver.findElement(By.id("gbqfb")).click();
  </code></pre>
  
  <p>I want to use jQuery with WebDriver to click the button. How can I do it?</p>
  
  <p>I did the following (Test was run in eclipse by using TestNG framework):</p>
  
  <pre><code>WebDriver driver = new FirefoxDriver();
  JavascriptExecutor jse = (JavascriptExecutor)driver;
  jse.executeScript("$('#gbqfba').click();");
  </code></pre>
  
  <p>Unfortunately the following error was displayed:</p>
  
  <p><strong>org.openqa.selenium.WebDriverException: $ is not defined (WARNING: The server did not provide any stacktrace information)
  Command duration or timeout: 23 milliseconds</strong></p>
  
  <p>What's the wrong with my above code?</p>