gecko-dev/servo/tests/html/test-js-image.html

21 строка
543 B
HTML

<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>