mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
[assert] element.getElementsByTagName
This commit is contained in:
parent
e32c69f05f
commit
59612be1f8
26
test/ecmascript/assert/element.getElementsByTagName.html
Normal file
26
test/ecmascript/assert/element.getElementsByTagName.html
Normal file
@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body id="body">
|
||||
|
||||
First Name: <input name="fname" type="text" value="Michael"><br>
|
||||
First Name: <input name="fname" type="text" value="Doug">
|
||||
|
||||
<p>Click the button to get the tag name of the first element in the body that has tag P.</p>
|
||||
|
||||
<button onclick="myFunction()">Try it</button>
|
||||
|
||||
<p id="demo"></p>
|
||||
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.getElementById('body').getElementsByTagName("P").item(0).outerHTML;
|
||||
console.assert(x === '<P>Click the button to get the tag name of the first element in the body that has tag P.</P>', 'first p');
|
||||
}
|
||||
|
||||
console.error('element.getElementByTagName.html');
|
||||
myFunction();
|
||||
console.exit(0);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user