JavaScript 更改 HTML 属性值
AI摘要
由
Deepseek提供支持
<button onclick="document.getElementById('myImage').src='https://img.8i5.net/image/bulboff.gif'">Turn on the light</button>
<img id="myImage" src="https://img.8i5.net/image/bulboff.gif" style="width:100px">
<button onclick="document.getElementById('myImage').src='https://img.8i5.net/image/bulboff.gif'">Turn off the light</button>
JavaScript 更改了标记的src(source) 属性的值:<img>
示例:
温馨提示 : 非特殊注明,否则均为©李联华的博客网原创文章,本站文章未经授权禁止任何形式转载;来自:俄亥俄州·哥伦布 ,欢迎您的访问!
文章链接:https://www.lilianhua.com/javascript-changes-the-html-attribute-value.html
文章链接:https://www.lilianhua.com/javascript-changes-the-html-attribute-value.html

