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

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -