本文實(shí)例講述了JS實(shí)現(xiàn)動(dòng)態(tài)給圖片添加邊框的方法。分享給大家供大家參考。具體如下:
下面的JS代碼設(shè)置圖片的邊框?yàn)?個(gè)像素,即border=2
<!DOCTYPE html><html><head><script>function addBorder(){document.getElementById("compman").border="2";}</script></head><body><img id="compman" src="compman.gif" alt="Computerman" width="107" height="98"><br><br><input type="button" onclick="addBorder()" value="Add border"></body></html>希望本文所述對(duì)大家的javascript程序設(shè)計(jì)有所幫助。
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注