dimanche 8 février 2015

Jquery If/Else always evaluating to true

Having a little trouble with an if/else seems to be always true



a id="test" class="art-bottom detailvid" href="/redblank" target="_blank">Check-In Video</a>

$(document).ready(function() {

if ($('a[href="/blank"]')) {
$( "a" ).append( '<img src="http://ift.tt/1KyBht3" height="28px" width="28px">' );
} else {
$( "a" ).append( '<img src="http://ift.tt/170wqme" height="28px" width="28px">' );
}

});


so no matter what I make href it still show the first photo.


What is the issue?


Aucun commentaire:

Enregistrer un commentaire