<div class="codetitle"> <span><a style="CURSOR: pointer" data="33773" class="copybut" id="copybut33773" onclick="doCopy('code33773')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code33773"> <br>function checkPhoto(fnUpload) <br>{ <br>var filename = fnUpload.value; <br>alert(filename); <br>var mime = filename.toLowerCase().substr(filename.lastIndexOf(".")); <br>if(mime!=".jpg") <br>{ <br>alert("请选择jpg格式的照片上传"); <br>fnUpload.outerHTML=fnUpload.outerHTML; <br>} <br>} <br> </div>