How to hide an element in jQuery -
am having following code..
<img src="" id="image1" > <img src="www" id="image1" > <img src="" id="image2" > <img src="www" id="image2" > <div id="imagesrc"></div>
how can hide div
id
(#imagesrc)
when #image1
have src=""
, , show div
(#imagesrc
) when #image1
have src !=""
?
try
$(document).ready(function () { if ($("#image1").attr("src") == "") { $("#imagesrc").hide(); } else { $("#imagesrc").show(); } });
update
$("#image1").change(function () { var imgcontrolname = "#imagesrc"; readurl(this, imgcontrolname); if (jquery("#preview").attr("src") == "") { jquery("#remove").hide(); } else { jquery("#remove").show(); } });
Comments
Post a Comment