• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

call function in jquery script

Hi.

I got my jquery script and I would like to call the function $("#autocomplete").autocomplete when I click.

$(function(){
      $("#autocomplete").click(function(e) {
            
            CALL The autocomplete function
      }),
      $("#autocomplete").autocomplete({ function })
0
Jesper Christensen
Asked:
Jesper Christensen
  • 4
  • 3
  • 2
4 Solutions
 
chaitu chaituCommented:
u mean like this.

(function(){
      $("#autocomplete").click(function(e) {
            autocomplete();
                  });

0
 
Jesper ChristensenProgrammerAuthor Commented:
Then i get an error:

error: autocomplete is not a function
0
 
Roman GhermanSenior Software EngineerCommented:
$(function(){
      $("#autocomplete").click(function(e) {
           
                  $(this).autocomplete({ function })
      }),
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
Jesper ChristensenProgrammerAuthor Commented:
But I want to call autocomplete.

autocomplete has a lot of code.

0
 
Roman GhermanSenior Software EngineerCommented:
$(this) will reference to  $("#autocomplete")

what do you want to do really?
0
 
Jesper ChristensenProgrammerAuthor Commented:
Thanks guys. Now it works :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now