blob: 96c755510d18b8725de93d75e3da398a5bd2a696 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<img src="test.jpeg" width="50" height="378"/>
<script>
function setWidth(w, i) {
elem.width = w;
window.alert(elem.width);
w += i;
if (w == 0 || w == 1000)
i *= -1;
window.setTimeout(function() { setWidth(w, i); }, 50);
}
var elem = window.document.documentElement.firstChild.firstChild.nextSibling.firstChild;
window.alert(elem.tagName);
window.alert(elem instanceof HTMLImageElement);
window.alert(elem instanceof HTMLElement);
window.alert(elem instanceof Element);
window.alert(elem.width);
setWidth(1000, -10);
</script>
|