Skip to main content

Bug Tracker

Side navigation

Ticket #2280: align.html

File align.html, 1.8 KB (added by choan, February 04, 2008 01:58PM UTC)

Tests (to be put inside the "test/" folder)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

<html xmlns="" xml:lang="en" lang="en">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

  <title>Test align</title>
  <link rel="Stylesheet" media="screen" href="data/testsuite.css"/>
  <script type="text/javascript" src="../dist/jquery.js"></script>
  <script type="text/javascript" src="data/testrunner.js"></script>
  test("Selection by align attribute", function() {
  	ok($('table[align]').length == 2, "table[align]" );
  	ok($('table[align=left]').length == 0, "table[align=left]");
  	ok($('th[align]').length == 1, "th[align]");
  	ok($('th[align=left]').length == 1, "th[align=left]");
  	ok($('tr[align=left]').length == 1, "tr[align=left]");
  	ok($('table[align=center]').length == 1, "table[align=center]");
  	ok($('#aligned [align]').length == 1, "#aligned [align]");
  	ok($('#aligned [align=center]').length == 1, "#aligned [align=center]");
  	ok($('#aligned [align=left]').length == 0, "#aligned [align=left]");
  	ok($('#not-aligned [align]').length == 0, "#not-aligned [align]");
  	ok($('#multi-align [align]').length == 3, "#multi-align [align]");

	<h1 id="header">jQuery - Test selection by align attribute</h1>
	<h2 id="banner"></h2>
	<h2 id="userAgent"></h2>

<div id="main">

<div id="aligned">
<table align="center"><tbody>

<div id="not-aligned">
<tbody>  <tr><th>Header</th></tr>

<div id="multi-align">
<table align="right">
<tbody>  <tr><th align="left">Header</th></tr>
  <tr align="left"><td>Data</td></tr>


<ol id="tests"></ol>


Download in other formats:

Original Format