Q:

get image contain the attribute onclick then hide the img

selector can get image contain the attribute onclick 
within the onclick there is a JS code ( windows.open ....href start with (/dailyTickets/front/requesttype.form.php)  )  
i want some thing like this :
 var attr = $('img').attr('onclick');
    if(typeof attr !== 'undefined' && attr !== false)
    {
$ImgIndex = $('img').attr('onclick').value().indexOf("var w = window.open('/dailyTickets/front/requesttype.form.php").index();

       if ($('img').attr('onclick').value().indexOf("var w = window.open('/dailyTickets/front/requesttype.form.php") == 0)
    {
       $('img:eq('"+$ImgIndex +"').hide();
    }
    }

you can test it here : http://jsfiddle.net/zu44E/3/
here is the image :  
<img 
    alt="" 
    title="Ajouter" 
    src="/dailyTickets/pics/add_dropdown.png" 
    style="cursor:pointer; margin-left:2px;" 
    onclick="var w = window.open('/dailyTickets/front/requesttype.form.php?popup=1&amp;rand=1489777051', 'glpipopup', 'height=400, width=1000, top=100, left=100, scrollbars=yes' );w.focus();"
></img>

A:

I think your method is slightly off.  First of all.  Here's my update:
http://jsfiddle.net/zu44E/7/
Here are the major changes I made:

After selecting an attr you don't get the value of that attr by calling value()
If you assign a variable to a series of chained function calls, what you end up with is the last value in the chain not the first so the value of your $ImgContains variable, had your method worked, would have been a true/false because you equate the indexOf to 0 (thus boolean, true or false)
Take advantage of jquery.  Jquery can do bulk operations on records.  You don't need to go element-by-element looking for things.  In the case you need to do a test that's more in depth and it is more or less element by element, use iterative jquery methods such as filter

