jquery - FadeOut element -


i trying fadeout elements using code

$('[title!="head"]').each(function () {     $(this).fadeout(100); }); 

with above code, elements fading out including ones $('[title="head"]').

the code works condition

$('[title="head"]') 

any comments highly appreciated.

you can use filter filtering elements having title not "head"

demo

$(document).ready(function() {    $('div')      .filter(function() {        return $(this).attr('title') !== 'head';      })      .fadeout(100);  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>  <div title="head">head</div>  <div title="myhead">my head</div>  <div title="your head">your head</div>  <div title="head">again head</div>  <div title="headno">head no</div>


Comments

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -