js點擊按鈕顯示圖片,再點擊關閉圖片最佳完美解決方案


1 result += "<img id='comfirmPic1Local' style='display:none' >"
2 result += "<button id='lookPic'  onclick='findPic1Local("+comfirmPic1Local+","+lookPic+")'>查看回單</button>"
 
        
1 function findPic1Local(comfirmPic1Local,lookPic) {
2 if(document.getElementById(lookPic).innerHTML=="查看回單") {
3     document.getElementById(comfirmPic1Local).style.display = "block";
4     document.getElementById(lookPic).innerHTML="隱藏回單";
5 }else if(document.getElementById(lookPic).innerHTML=="隱藏回單"){
6     document.getElementById(comfirmPic1Local).style.display = "none";
7     document.getElementById(lookPic).innerHTML="查看回單";
8 }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM