Note that there are some explanatory texts on larger screens.

plurals
  1. POhtml form fade with more than one form
    text
    copied!<p>As you guys know, the .fadeOut and .fadeIn command can be used to fade various elements in and out. My problem is that I have multiple forms and unlike paragraphs whose tags can be made unique through incrementation all forms have the exact same tag. I want to fade out 1 or more forms while leaving the others intact. What can I do? Can I create a custom form tag? Is there a fade command that allows the user to specify the id of the element?</p> <p>For example:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt; &lt;/script&gt; &lt;script&gt; $(document).ready(function(){ $(".btn1").click(function(){ $("p").fadeOut() $("form1").fadeOut() }); $(".btn2").click(function(){ $("p").fadeIn(); document.getElementById("form").fadeOut() }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id=form1&gt; &lt;input id="check1" type="checkbox" /&gt;Print Design &lt;/form&gt; &lt;form id=form2&gt; &lt;input id="check3" type="checkbox" /&gt;Web Design &lt;/form&gt; &lt;p&gt;This is a paragraph.&lt;/p&gt; &lt;button class="btn1"&gt;Fade out&lt;/button&gt; &lt;button class="btn2"&gt;Fade in&lt;/button&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><a href="http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_eff_fadeout_fadein" rel="nofollow">http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_eff_fadeout_fadein</a></p> <p>Paste the above code into the compiler at w3schools. You will find that simply putting the ID number in as the argument does not work. This is because the command is expecting a kind of tag like the <p> tag.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload