ELEMENTS_BY_TAG_NAME

Syntax

ELEMENTS_BY_TAG_NAME(<string [containing HTML elements]>;<tag name>)

Description

Returns all elements with a specified tag name as a list.

Example

Download the example file: HTML_File_Example.html

Given the following excerpt from the HTML file:

<body>
<h1>Affected People</h1>
	<table border="1" rules="groups">
		<thead>
			<tr>
				<th>Association 1</th>
				<th>Association 2</th>
				<th>Association 3</th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td><i>affected:<br>4 Million People</i></td>
				<td><i>affected:<br>2 Million People</i></td>
				<td><i>affected:<br>1 Million People</i></td>
			</tr>
		</tfoot>
		<tbody>
			<tr>
				<td>New York</td>
				<td>San Francisco</td>
				<td>Atlanta</td>
			</tr>
			<tr>
				<td>Bread</td>
				<td>Biscuits</td>
				<td>Rolls</td>
			</tr>
			<tr>
				<td>Sandwich</td>
				<td>Soup</td>
				<td>Salad</td>
			</tr>
		</tbody>
	</table>
</body>

Return all the HTML elements in italics.

Select the column with your HTML data as the HTML argument and use i as the tag name argument.

The result is all of the <i> elements displayed as a list.

[<i>affected:<br />4 Million People</i>, <i>affected:<br />2 Million People</i>, <i>affected:<br />1 Million People</i>]