1

My code is:

...
<li onclick="myFunc()">text</li>
...

and my javaScript code is:

function myFunc(){

}

function otherFunc(){

}

now i need to call 'otherFunc' function after 'li' clicked.

2
  • call 'otherFunc' inside 'myFunc' function!!! Commented Jul 2, 2016 at 22:25
  • you allright. thanks @MHS Commented Jul 2, 2016 at 22:32

3 Answers 3

2

You can call otherFunc() at close of myFunc()

function myFunc(){
  // do stuff
  otherFunc()
}
Sign up to request clarification or add additional context in comments.

Comments

0
<li onclick="myFunc(); otherFunc();">text</li>

Comments

0

Use the following markup:

...
<li onclick="comprehensiveClickHandlerFunc()">text</li>
...

Use the following script:

function comprehensiveClickHandlerFunc(){
    myFunc();
    return otherFunc();
}

function myFunc(){

}

function otherFunc(){

}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.