Menu Search Me

Call JQuery Method to Achieve HTML Effect

Created by info on 2014-01-26

Not only can you put your own custom JavaScript code into a JQuery event, in your JavaScript code segment, you can also call a JQuery method to achieve your desired HTML effects like Hide, Show, Toggle, Slide, Fade, and Animate.

Let's look at the following example:

<!DOCTYPE html>
<script src="">
<p>This is a paragraph with little content.</p>
<p>This is another small paragraph.</p>

In the above example, when a user clicks the button, a JQuery event "click" is fired. This will invoke your custom code inside the $("button").click JQuery event. And the custom code just hides the text enclosed by the <p> tag.